Mounting and Access Control

There are a number of mount options for usbfs, which will be of most interest to you if you need to override the default access control policy. That policy is that only root may read or write device files (/proc/bus/BBB/DDD) although anyone may read the devices or drivers files. I/O requests to the device also need the CAP_SYS_RAWIO capability,

The significance of that is that by default, all user mode device drivers need super-user privileges. You can change modes or ownership in a driver setup when the device hotplugs, or maye just start the driver right then, as a privileged server (or some activity within one). That's the most secure approach for multi-user systems, but for single user systems ("trusted" by that user) it's more convenient just to grant everyone all access (using the devmode=0666 option) so the driver can start whenever it's needed.

The mount options for usbfs, usable in /etc/fstab or in command line invocations of mount, are:

busgid=NNNNN

Controls the GID used for the /proc/bus/usb/BBB directories. (Default: 0)

busmode=MMM

Controls the file mode used for the /proc/bus/usb/BBB directories. (Default: 0555)

busuid=NNNNN

Controls the UID used for the /proc/bus/usb/BBB directories. (Default: 0)

devgid=NNNNN

Controls the GID used for the /proc/bus/usb/BBB/DDD files. (Default: 0)

devmode=MMM

Controls the file mode used for the /proc/bus/usb/BBB/DDD files. (Default: 0644)

devuid=NNNNN

Controls the UID used for the /proc/bus/usb/BBB/DDD files. (Default: 0)

listgid=NNNNN

Controls the GID used for the /proc/bus/usb/devices and drivers files. (Default: 0)

listmode=MMM

Controls the file mode used for the /proc/bus/usb/devices and drivers files. (Default: 0444)

listuid=NNNNN

Controls the UID used for the /proc/bus/usb/devices and drivers files. (Default: 0)

Note that many Linux distributions hard-wire the mount options for usbfs in their init scripts, such as /etc/rc.d/rc.sysinit, rather than making it easy to set this per-system policy in /etc/fstab.