Subject: Re: Mounting as read-write
To: Nick Vanderweit <nickv_111@yahoo.com>
From: Steven M. Bellovin <smb@research.att.com>
List: port-i386
Date: 01/26/2004 22:31:04
In message <20040127032433.6386.qmail@web12007.mail.yahoo.com>, Nick Vanderweit
 writes:
>Hi! I just installed NetBSD on a friend's computer,
>and I was wondering how you could make it so that
>anyone could mount fd0a, and how they could all have
>read-write access WITHOUT accessing root. I am more
>focussed on the second part, but if there was a way to
>do both, it would be best. I already added the line in
>/etc/fstab, but if one of the users who doesn't have
>access to root wants to mount and edit... I was
>thinking of using a script that runs using SUID root,
>but it seems insecure. So, how could I make it so a
>user could mount and edit a device without being root?
>

Use the automount daemon (amd).

Since getting it set up right is a pain -- amd can do far more than 
most people need -- let me include my files.  In /etc/amd.conf, I have 
these lines:

[ global ]
dismount_interval =     120

[ /r ]
map_name =              /etc/amd/r



In /etc/amd/r, I have this:

/defaults       type:=pcfs

key             dev:=/dev/sd0d
okey            dev:=/dev/sd0e
floppy          dev:=/dev/fd0a
cd              dev:=/dev/cd0a;type:=cdfs;opts:=ro
cf              dev:=/dev/wd1e
win2k           dev:=/dev/wd0f


Everything is mounted as a subdirectory of /r -- /r/floppy, /r/cd, etc.
*Don't* try to have /floppy as a symlink to /r/floppy, or lots of 
programs that put up dialog boxes will annoy you trying to get at the 
floppy.


		--Steve Bellovin, http://www.research.att.com/~smb