Fedora notes

Saturday, February 12, 2005

Mount Filesystems By Common User

There are several ways of mounting filesystem by common users. But I finally found using "uid,gid" options is so straightforward and what I feel best. At the very beginning, I used to use "defaults, umask=000, ..." which makes root to mount but enables everybody to read and write. It's no good because of security issue. The second way I used is "noauto,user,..." which enables one user to mount and umount explicitly. It's a generally ok solution, but I have to invoke mount when login, which troubles me where to put the script for mounting. .bash_profile? no, because everytime a new bash session is established, the script is executed. probably put it in .Xclients? ye, but still troublesome.

What I found today in mount's manual page is that several filesystems' mount can have uid and gid options, including vfat, smbfs, ... some examples of fstab as follow:

/dev/hda1 /mnt/hda1 vfat defaults,uid=zz,gid=zz,iocharset=cp936,codepage=936 0 0
//sambashare/ /mnt/share smbfs defaults,uid=zz,gid=zz,username=domain/user%pwd 0 0

0 Comments:

Post a Comment

<< Home