[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: autofs for all users



*- On  5 Jun, Stefan Baums wrote about "autofs for all users"
> Hi all,
> 
> I am using autofs. My /etc/auto.master is:
> 
> 	/mnt/amnt       /etc/auto.amnt  --timeout 1
> 
> and my /etc/auto.amnt is:
> 
> 	cdrom           -fstype=iso9660,ro,user         :/dev/hdc
> 	floppy          -fstype=auto,rw,user            :/dev/fd0
> 
> If I access /mnt/amnt/floppy for reading, everything is fine. If I try to write
> something to the disk as ordinary user, I get:
> 
> 	cp: cannot create regular file `/mnt/amnt/floppy/test': Permission denied
> 
> The problem seems to be: If Joe User accesses /mnt/amnt/floppy, the automount
> daemon, _running as root_, calls mount _as root_ so that root is the owner of
> /mnt/amnt/floppy and the only one allowed to write there.
> 
> How can I let ordinary users access the floppy for writing?
> 

You need to set the permissions so that ordinary users can write to the
device.  This is my setup:

#/etc/auto.master
/rmd    /etc/auto.rmd   -t 30

#/etc/auto.rmd
a       -fstype=auto,rw,uid=0,gid=35,umask=007,unhide,sync,quite  :/dev/fd0
z       -fstype=iso9660,ro,uid=0,gid=35 :/dev/hdd

Notice the user and group id's as well as the umask. I then have all
users that I want to be able to access the drives in group GID=35(I
call it group dos, but it can be anything you want).  When autofs mounts
the drives it mounts them with permissions root.dos rwxrwx---.   I also
have identical lines in my /etc/fstab so that the user can unmount them
manually with umount if they wish.

/dev/hdd              /rmd/z    iso9660 noauto,user,ro,uid=0,gid=35  0   0
/dev/fd0              /rmd/a    auto    noauto,user,rw,uid=0,gid=35,umask=007,unhide,sync,quite 0   0

The same can be done for other filesystem type partitions if you want,
say a win95 partition that you don't want to have mounted all the time.

This works for me, YMMV.

-- 
Brian 
---------------------------------------------------------------------
Mechanical Engineering                              servis@purdue.edu
Purdue University                   http://www.ecn.purdue.edu/~servis
---------------------------------------------------------------------


Reply to: