From owner-freebsd-doc Wed Oct 25 18:20:14 2000 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EC7FB37B4D7 for ; Wed, 25 Oct 2000 18:20:02 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id SAA96413; Wed, 25 Oct 2000 18:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from guru.mired.org (okc-27-149-77.mmcable.com [24.27.149.77]) by hub.freebsd.org (Postfix) with SMTP id 774E737B479 for ; Wed, 25 Oct 2000 18:15:11 -0700 (PDT) Received: (qmail 2716 invoked by uid 100); 26 Oct 2000 01:15:10 -0000 Message-Id: <20001026011510.2715.qmail@guru.mired.org> Date: 26 Oct 2000 01:15:10 -0000 From: mwm@mired.org Reply-To: mwm@mired.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: docs/22297: The FAQ entry for users mounting removable media needs updating Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22297 >Category: docs >Synopsis: The FAQ entry for users mounting removable media needs updating >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: Wed Oct 25 18:20:02 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Mike Meyer >Release: FreeBSD 5.0-CURRENT i386 >Organization: Meyer Consulting >Environment: People aren't often asking "how do I let users mount a floppy"; rather they are asking "how do I let users mount a cdrom". >Description: I think the emphasis on floppies in the FAQ entry is making them miss it. The FAQ entry is also missing a step (adding an entry to /etc/sysctl.conf) and is overpermissive in setting device permissions. >How-To-Repeat: Read -questions for a while, and watch. >Fix: The attached patch to the FAQ file adds CDROMs to the title and procedure, lowers the device permissions a bit, including an example on how to restrict the ability to a group, and adds the sysctl.conf step. I reorganized the text a bit to work better with the new information. --- book.sgml Tue Oct 17 18:17:14 2000 +++ /tmp/book.sgml Wed Oct 25 20:14:12 2000 @@ -6343,7 +6343,7 @@ - How do I let ordinary users mount floppies and other removable + How do I let ordinary users mount floppies, CDROMs and other removable media? @@ -6353,6 +6353,14 @@ + As root set the sysctl variable + vfs.usermount to + 1. + + &prompt.root; sysctl -w vfs.usermount=1 + + + As root assign the appropriate permissions to the block device associated with the removable media. @@ -6360,33 +6368,47 @@ For example, to allow users to mount the first floppy drive, use: - &prompt.root; chmod 777 /dev/fd0 - + &prompt.root; chmod 666 /dev/fd0 - - As root set the sysctl variable - vfs.usermount to - 1. + To allow users in the group + operator to mount the cdrom drive, + use: - &prompt.root; sysctl -w vfs.usermount=1 + &prompt.root; chgrp operator /dev/cd0c +&prompt.root; chmod 640 /dev/cd0c + + + Finally, add the line + vfs.usermount=1 to the file + /etc/sysctl.conf so that it is reset + at system boot time. + - Users can now mount /dev/fd0 onto a - directory that they own: + All users can now mount the floppy + /dev/fd0 onto a directory that they + own: &prompt.user; mkdir ~/my-mount-point &prompt.user; mount -t msdos /dev/fd0 ~/my-mount-point + Users in group operator can now + mount the cdrom /dev/cd0c onto a + directory that they own: + + &prompt.user; mkdir ~/my-mount-point +&prompt.user; mount -t msdos /dev/cd0c ~/my-mount-point + Unmounting the device is simple: &prompt.user; umount ~/my-mount-point Enabling vfs.usermount, however, has negative security implications. A better way to access MSDOS - formatted media is to use the mtools - package in the ports collection. + formatted media (not CDROMs) is to + use the mtools package in the ports collection. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message