View | Details | Raw Unified | Return to bug 22297
Collapse All | Expand All

(-)/tmp/book.sgml (-13 / +35 lines)
Lines 6343-6349 Link Here
6343
6343
6344
      <qandaentry>
6344
      <qandaentry>
6345
        <question>
6345
        <question>
6346
          <para>How do I let ordinary users mount floppies and other removable
6346
          <para>How do I let ordinary users mount floppies, CDROMs and other removable
6347
            media?</para>
6347
            media?</para>
6348
        </question>
6348
        </question>
6349
6349
Lines 6353-6358 Link Here
6353
6353
6354
          <procedure>
6354
          <procedure>
6355
            <step>
6355
            <step>
6356
              <para>As <username>root</username> set the sysctl variable
6357
                <varname>vfs.usermount</varname> to
6358
                <literal>1</literal>.</para>
6359
6360
              <screen>&prompt.root; <userinput>sysctl -w vfs.usermount=1</userinput></screen>
6361
            </step>
6362
6363
            <step>
6356
              <para>As <username>root</username> assign the appropriate
6364
              <para>As <username>root</username> assign the appropriate
6357
                permissions to the block device associated with the
6365
                permissions to the block device associated with the
6358
                removable media.</para>
6366
                removable media.</para>
Lines 6360-6392 Link Here
6360
              <para>For example, to allow users to mount the first floppy
6368
              <para>For example, to allow users to mount the first floppy
6361
                drive, use:</para>
6369
                drive, use:</para>
6362
6370
6363
              <screen>&prompt.root; <userinput>chmod 777 /dev/fd0</userinput></screen>
6371
              <screen>&prompt.root; <userinput>chmod 666 /dev/fd0</userinput></screen>
6364
            </step>
6365
6372
6366
            <step>
6373
              <para>To allow users in the group
6367
              <para>As <username>root</username> set the sysctl variable
6374
                <username>operator</username> to mount the cdrom drive,
6368
                <varname>vfs.usermount</varname> to
6375
                use:</para>
6369
                <literal>1</literal>.</para>
6370
6376
6371
              <screen>&prompt.root; <userinput>sysctl -w vfs.usermount=1</userinput></screen>
6377
              <screen>&prompt.root; <userinput>chgrp operator /dev/cd0c</userinput>
6378
&prompt.root; <userinput>chmod 640 /dev/cd0c</userinput></screen>
6372
            </step>
6379
            </step>
6380
6381
	    <step>
6382
	      <para>Finally, add the line
6383
		<literal>vfs.usermount=1</literal> to the file
6384
		<filename>/etc/sysctl.conf</filename> so that it is reset
6385
		at system boot time.</para>
6386
	    </step>
6373
          </procedure>
6387
          </procedure>
6374
6388
6375
          <para>Users can now mount <filename>/dev/fd0</filename> onto a
6389
          <para>All users can now mount the floppy
6376
            directory that they own:</para>
6390
            <filename>/dev/fd0</filename> onto a directory that they
6391
            own:</para>
6377
6392
6378
          <screen>&prompt.user; <userinput> mkdir ~/my-mount-point</userinput>
6393
          <screen>&prompt.user; <userinput> mkdir ~/my-mount-point</userinput>
6379
&prompt.user; <userinput> mount -t msdos /dev/fd0 ~/my-mount-point</userinput></screen>
6394
&prompt.user; <userinput> mount -t msdos /dev/fd0 ~/my-mount-point</userinput></screen>
6380
6395
6396
          <para>Users in group <username>operator</username> can now
6397
            mount the cdrom <filename>/dev/cd0c</filename> onto a
6398
            directory that they own:</para>
6399
6400
          <screen>&prompt.user; <userinput> mkdir ~/my-mount-point</userinput>
6401
&prompt.user; <userinput> mount -t msdos /dev/cd0c ~/my-mount-point</userinput></screen>
6402
6381
          <para>Unmounting the device is simple:</para>
6403
          <para>Unmounting the device is simple:</para>
6382
6404
6383
          <screen>&prompt.user; <userinput>umount <filename>~/my-mount-point</filename></userinput></screen>
6405
          <screen>&prompt.user; <userinput>umount <filename>~/my-mount-point</filename></userinput></screen>
6384
6406
6385
          <para>Enabling <varname>vfs.usermount</varname>, however, has
6407
          <para>Enabling <varname>vfs.usermount</varname>, however, has
6386
            negative security implications.  A better way to access MSDOS
6408
            negative security implications.  A better way to access MSDOS
6387
            formatted media is to use the <ulink
6409
            formatted media (<emphasis>not CDROMs</emphasis>) is to
6388
            URL="http://www.freebsd.org/cgi/ports.cgi?query=%5Emtools-&amp;stype=name">mtools</ulink>
6410
	    use the <ulink
6389
            package in the ports collection.</para>
6411
	    URL="http://www.freebsd.org/cgi/ports.cgi?query=%5Emtools-&amp;stype=name">mtools</ulink> package in the ports collection.</para> 
6390
        </answer>
6412
        </answer>
6391
      </qandaentry>
6413
      </qandaentry>

Return to bug 22297