Ubuntu – How to allow software access to any USB devices


I have a libusb-based program that can't open USB devices on a freshly installed Ubuntu because it lacks permissions.

This solution will probably work for me, but it requires manually specifying each and every device – and I have quite a few. So I tried this (in a file /etc/udev/rules.d/41-cvs-permissions.rules):

SUBSYSTEM=="usb", MODE:="0666"

I've omitted VID and PID, hoping that it will simply apply the rule to ALL devices. It definitely has some effect, but the effect is rather weird: instead of detecting 5 devices that it can't open, libusb only detects 2 now – both are USB host controllers, not actual devices.

How to achieve what I want?

Best Answer

  • The way I deal with USB devices is to give a specific group access to all of them.

    As root:

    echo 'SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev"' > /etc/udev/rules.d/00-usb-permissions.rules
    udevadm control --reload-rules

    Essentially what this does is grant read and write access for any usb device to members of the plugdev group.

  • Related Question