docs/76942: [PATCH] FAQ: Mounting as users: Cleanup and move to 5.X
David Adam
zanchey at ucc.gu.uwa.edu.au
Wed Feb 2 07:30:49 UTC 2005
Apologies for the Base64.
Patch is now inline or can be accessed at
http://zanchey.ucc.asn.au/freebsd/faq.book.sgml.patch
David Adam
zanchey at ucc.gu.uwa.edu.au
-----
--- faq.book.sgml.orig 2005-02-01 13:10:22.000000000 +0800
+++ faq.book.sgml 2005-02-02 10:43:08.000000000 +0800
@@ -6174,17 +6174,21 @@
<qandaentry>
<question id="user-floppymount">
- <para>How do I let ordinary users mount floppies, CDROMs and
+ <para>How do I let ordinary users mount floppies, CD-ROMs and
other removable media?</para>
</question>
<answer>
<para>Ordinary users can be permitted to mount devices. Here is
how:</para>
+
+ <note>On &os; 4.X and below, you should replace the device <filename>
+ /dev/acd0</filename> with <filename>/dev/acd0c</filename> in the examples
+ below.</note>
<procedure>
<step>
- <para>As <username>root</username> set the sysctl variable
+ <para>As <username>root</username>, set the sysctl variable
<varname>vfs.usermount</varname> to
<literal>1</literal>.</para>
@@ -6202,13 +6206,36 @@
<screen>&prompt.root; <userinput>chmod 666 /dev/fd0</userinput></screen>
<para>To allow users in the group
- <groupname>operator</groupname> to mount the CDROM drive,
+ <groupname>operator</groupname> to mount the CD-ROM drive,
use:</para>
- <screen>&prompt.root; <userinput>chgrp operator /dev/cd0c</userinput>
-&prompt.root; <userinput>chmod 640 /dev/cd0c</userinput></screen>
+ <screen>&prompt.root; <userinput>chgrp operator /dev/acd0</userinput>
+&prompt.root; <userinput>chmod 640 /dev/acd0</userinput></screen>
+
</step>
+ <step>
+ <para>You will need to alter your &man.devfs.conf.5; to make these
+ changes permanent across reboots.</para>
+
+ <note>This step does not apply to &os; 4.X and below.</note>
+
+ <para>As <username>root</username>, add the relevant lines to
+ <filename>/etc/devfs.conf</filename>. For example, to allow users
+ to mount the first floppy drive, add:</para>
+
+ <programlisting># Allow all users to mount the floppy disk.
+own /dev/fd0 root:operator
+perm /dev/fd0 0666</programlisting>
+
+ <para>To allow users in the group <groupname>operator</groupname
+ to mount the CD-ROM drive, add:</para>
+
+ <programlisting># Allow members of the group operator to mount CD-ROMs.
+own /dev/acd0 root:operator
+perm /dev/acd0 0660
+ </step>
+
<step>
<para>Finally, add the line
<literal><varname>vfs.usermount</varname>=1</literal>
@@ -6225,21 +6252,21 @@
&prompt.user; <userinput>mount -t msdos /dev/fd0 ~/my-mount-point</userinput></screen>
<para>Users in group <groupname>operator</groupname> can now
- mount the CDROM <devicename>/dev/cd0c</devicename> onto a
+ mount the CD-ROM <devicename>/dev/acd0</devicename> onto a
directory that they own:</para>
<screen>&prompt.user; <userinput>mkdir ~/my-mount-point</userinput>
-&prompt.user; <userinput>mount -t cd9660 /dev/cd0c ~/my-mount-point</userinput></screen>
+&prompt.user; <userinput>mount -t cd9660 /dev/acd0 ~/my-mount-point</userinput></screen>
<para>Unmounting the device is simple:</para>
<screen>&prompt.user; <userinput>umount ~/my-mount-point</userinput></screen>
- <para>Enabling <varname>vfs.usermount</varname>, however,
+ <note>Enabling <varname>vfs.usermount</varname>
has negative security implications. A better way to
access &ms-dos; formatted media is to use the
<filename role="package">emulators/mtools</filename>
- package in the ports collection.</para>
+ package in the ports collection.</note>
</answer>
</qandaentry>
More information about the freebsd-doc
mailing list