|1)||/dev/bus/usb - pre-2.6.11: via devfs / post-2.6.11: via udev|
|2)||/proc/bus/usb - usbfs|
No matter which method your system uses, you will probably want to create a separate group to control access. Run this command to add a system group:
addgroup --system usb
groupadd --system usb
You can then add users to that group to allow access to your usb devices.
DEVFS / HOTPLUG
If you use Debian/Ubuntu, look in the /etc/udev/permissions.rules file. If you want to allow global access to all usb devices, make this change:
SUBSYSTEM==usb_device, MODE=0664, GROUP=usb
After you reboot, all usb devices will inherit the mode and group specified.
If you want to only change permissions for certain devices, you can add this on one line and adjust the product and vendor IDs:
SUBSYSTEM=="usb_device", GROUP="usb", \
The usbfs defaults to root as the user and group. This can be changed in the /etc/fstab by adding the following on one line:
none /proc/bus/usb usbfs noauto,\
The value 118 in the above should be replaced with the group id of your usb group (created above). The list* values are to allow listing devices, the bus* is to control access to the bus directories and the dev* values control access to the device files. This approach does not allow the kind of granular permission that the udev approach gives, so it is all or nothing unless permissions are changed programmatically.
If your /etc/fstab file already has a line for /proc/bus/usb, add the options above to the line that is already there rather than adding the new line. For example, you would change
usbfs /proc/bus/usb usbfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto,\
Once again, this needs to be all on one line with the \ characters removed.
Device::USB and the libusb library site at <http://libusb.sourceforge.net/>.
G. Wade Johnson (wade at anomaly dot org) Paul Archer (paul at paularcher dot org)
Houston Perl Mongers Group
Thanks go to various users who submitted questions and answers for the list. In particular, Anthony L. Awtrey who contributed the first FAQ answer.
Copyright 2006 Houston Perl Mongers
This document is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||DEVICE::USB::FAQ (3)||2006-09-03|