From owner-freebsd-doc@FreeBSD.ORG Tue Feb 1 06:40:05 2005 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65BBF16A4CE for ; Tue, 1 Feb 2005 06:40:05 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B0CB43D5D for ; Tue, 1 Feb 2005 06:40:05 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j116e4lj021333 for ; Tue, 1 Feb 2005 06:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j116e4U0021331; Tue, 1 Feb 2005 06:40:04 GMT (envelope-from gnats) Resent-Date: Tue, 1 Feb 2005 06:40:04 GMT Resent-Message-Id: <200502010640.j116e4U0021331@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, David Adam Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 718BE16A4CE for ; Tue, 1 Feb 2005 06:35:29 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34D3143D1D for ; Tue, 1 Feb 2005 06:35:29 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j116ZSeD000591 for ; Tue, 1 Feb 2005 06:35:28 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j116ZSSP000590; Tue, 1 Feb 2005 06:35:28 GMT (envelope-from nobody) Message-Id: <200502010635.j116ZSSP000590@www.freebsd.org> Date: Tue, 1 Feb 2005 06:35:28 GMT From: David Adam To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: docs/76942: [PATCH] FAQ: Mounting as users: Cleanup and move to 5.X X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2005 06:40:05 -0000 >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 @@ - How do I let ordinary users mount floppies, CDROMs and + How do I let ordinary users mount floppies, CD-ROMs and other removable media? Ordinary users can be permitted to mount devices. Here is how: + + On &os; 4.X and below, you should replace the device + /dev/acd0 with /dev/cd0c in the examples + below. - As root set the sysctl variable + As root, set the sysctl variable vfs.usermount to 1. @@ -6202,13 +6206,36 @@ &prompt.root; chmod 666 /dev/fd0 To allow users in the group - operator to mount the CDROM drive, + operator to mount the CD-ROM drive, use: - &prompt.root; chgrp operator /dev/cd0c -&prompt.root; chmod 640 /dev/cd0c + &prompt.root; chgrp operator /dev/acd0 +&prompt.root; chmod 640 /dev/acd0 + + + You will need to alter your &man.devfs.conf.5; to make these + changes permanent across reboots. + + This step does not apply to &os; 4.X and below. + + As root, add the relevant lines to + /etc/devfs.conf. For example, to allow users + to mount the first floppy drive, add: + + # Allow all users to mount the floppy disk. +own /dev/fd0 root:operator +perm /dev/fd0 0666 + + To allow users in the group operator + + # Allow members of the group operator to mount CD-ROMs. +own /dev/acd0 root:operator +perm /dev/acd0 0660 + + Finally, add the line vfs.usermount=1 @@ -6225,21 +6252,21 @@ &prompt.user; mount -t msdos /dev/fd0 ~/my-mount-point Users in group operator can now - mount the CDROM /dev/cd0c onto a + mount the CD-ROM /dev/acd0 onto a directory that they own: &prompt.user; mkdir ~/my-mount-point -&prompt.user; mount -t cd9660 /dev/cd0c ~/my-mount-point +&prompt.user; mount -t cd9660 /dev/acd0 ~/my-mount-point Unmounting the device is simple: &prompt.user; umount ~/my-mount-point - Enabling vfs.usermount, however, + Enabling vfs.usermount, has negative security implications. A better way to access &ms-dos; formatted media is to use the emulators/mtools - package in the ports collection. + package in the ports collection. >Release-Note: >Audit-Trail: >Unformatted: