1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Mounting and Access Control</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux-USB Host Side API"><link rel="up" href="usbfs.html" title="Chapter 7. The USB Filesystem (usbfs)"><link rel="prev" href="usbfs.html" title="Chapter 7. The USB Filesystem (usbfs)"><link rel="next" href="usbfs-devices.html" title="/proc/bus/usb/devices"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Mounting and Access Control</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usbfs.html">Prev</a> </td><th width="60%" align="center">Chapter 7. The USB Filesystem (usbfs)</th><td width="20%" align="right"> <a accesskey="n" href="usbfs-devices.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="usbfs-fstab"></a>Mounting and Access Control</h2></div></div></div><p>There are a number of mount options for usbfs, which will 2 be of most interest to you if you need to override the default 3 access control policy. 4 That policy is that only root may read or write device files 5 (<code class="filename">/proc/bus/BBB/DDD</code>) although anyone may read 6 the <code class="filename">devices</code> 7 or <code class="filename">drivers</code> files. 8 I/O requests to the device also need the CAP_SYS_RAWIO capability, 9 </p><p>The significance of that is that by default, all user mode 10 device drivers need super-user privileges. 11 You can change modes or ownership in a driver setup 12 when the device hotplugs, or maye just start the 13 driver right then, as a privileged server (or some activity 14 within one). 15 That's the most secure approach for multi-user systems, 16 but for single user systems ("trusted" by that user) 17 it's more convenient just to grant everyone all access 18 (using the <span class="emphasis"><em>devmode=0666</em></span> option) 19 so the driver can start whenever it's needed. 20 </p><p>The mount options for usbfs, usable in /etc/fstab or 21 in command line invocations of <span class="emphasis"><em>mount</em></span>, are: 22 23 </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="emphasis"><em>busgid</em></span>=NNNNN</span></dt><dd><p>Controls the GID used for the 24 /proc/bus/usb/BBB 25 directories. (Default: 0)</p></dd><dt><span class="term"><span class="emphasis"><em>busmode</em></span>=MMM</span></dt><dd><p>Controls the file mode used for the 26 /proc/bus/usb/BBB 27 directories. (Default: 0555) 28 </p></dd><dt><span class="term"><span class="emphasis"><em>busuid</em></span>=NNNNN</span></dt><dd><p>Controls the UID used for the 29 /proc/bus/usb/BBB 30 directories. (Default: 0)</p></dd><dt><span class="term"><span class="emphasis"><em>devgid</em></span>=NNNNN</span></dt><dd><p>Controls the GID used for the 31 /proc/bus/usb/BBB/DDD 32 files. (Default: 0)</p></dd><dt><span class="term"><span class="emphasis"><em>devmode</em></span>=MMM</span></dt><dd><p>Controls the file mode used for the 33 /proc/bus/usb/BBB/DDD 34 files. (Default: 0644)</p></dd><dt><span class="term"><span class="emphasis"><em>devuid</em></span>=NNNNN</span></dt><dd><p>Controls the UID used for the 35 /proc/bus/usb/BBB/DDD 36 files. (Default: 0)</p></dd><dt><span class="term"><span class="emphasis"><em>listgid</em></span>=NNNNN</span></dt><dd><p>Controls the GID used for the 37 /proc/bus/usb/devices and drivers files. 38 (Default: 0)</p></dd><dt><span class="term"><span class="emphasis"><em>listmode</em></span>=MMM</span></dt><dd><p>Controls the file mode used for the 39 /proc/bus/usb/devices and drivers files. 40 (Default: 0444)</p></dd><dt><span class="term"><span class="emphasis"><em>listuid</em></span>=NNNNN</span></dt><dd><p>Controls the UID used for the 41 /proc/bus/usb/devices and drivers files. 42 (Default: 0)</p></dd></dl></div><p> 43 44 </p><p>Note that many Linux distributions hard-wire the mount options 45 for usbfs in their init scripts, such as 46 <code class="filename">/etc/rc.d/rc.sysinit</code>, 47 rather than making it easy to set this per-system 48 policy in <code class="filename">/etc/fstab</code>. 49 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="usbfs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="usbfs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="usbfs-devices.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. The USB Filesystem (usbfs) </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> /proc/bus/usb/devices</td></tr></table></div></body></html> 50