docs/76942: [PATCH] FAQ: Mounting as users: Cleanup and move to 5.X

David Adam zanchey at ucc.gu.uwa.edu.au
Tue Feb 1 06:40:05 UTC 2005


>Number:         76942
>Category:       docs
>Synopsis:       [PATCH] FAQ: Mounting as users: Cleanup and move to 5.X
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 01 06:40:04 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     David Adam
>Release:        FreeBSD 5-STABLE
>Organization:
University Computer Club, UWA
>Environment:
Linux mermaid 2.4.24-grsec-uccextras #1 Sat Feb 21 01:16:29 WST 2004 i586 unknown

>Description:
As mentioned in http://lists.freebsd.org/pipermail/freebsd-doc/2005-January/007012.html, the FAQ does not deal with allowing ordinary users to mount disks on FreeBSD versions > 4.
>How-To-Repeat:
Examine the FAQ entry currently numbered 9.22, with an id of user-floppymount.
>Fix:
Patch pasted below, also available at http://zanchey.ucc.asn.au/freebsd/faq.book.sgml.patch

--- faq.book.sgml.orig  2005-02-01 13:10:22.000000000 +0800
+++ faq.book.sgml       2005-02-01 14:10:37.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/cd0c</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>

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-doc mailing list