/etc/fstab Woes

Mikkel L. Ellertson mikkel at infinity-ltd.com
Wed Feb 8 16:41:24 UTC 2006


Ow Mun Heng wrote:
> On Tue, 2006-02-07 at 20:13 -0600, Mikkel L. Ellertson wrote:
> 
>>
>>Try adding umask=0.
>>
>>//server/share   /media/server/share   cifs
>>credentials=/home/user/.smbcredentials/user.cred,rw,user,umask=0 0 0
> 
> 
> 
> Isn't that supposed to be umask=000
>
Nope. I guess I should have done it this way instead.

//server/share   /media/server/share   cifs
credentials=/home/user/.smbcredentials/user.cred,umask=0,rw,user 0 0

The last 0 0 are there own fields.
> 
> This is what I do on a CLI
>  mount -t cifs -o
> username=xxx,password=yyy,uid=500 //server/share /mnt/pt
> 
The format when using mount from the command line is slightly
different from the format of /etc/fstab. When you run mount
directly, you do not need the check and dump fields.

Now, you can use umask or uid to limit access. You can also
get fancy and set directories separate from files.

uid=value and gid=value
   Set the owner and group of all files. (Default: the uid and  gid
   of the current process.)

umask=value
   Set  the  umask  (the  bitmask  of  the permissions that are not
   present). The default is the umask of the current process.   The
   value is given in octal.

dmask=value
   Set  the  umask applied to directories only.  The default is the
   umask of the current process.  The  value  is  given  in  octal.
   Present since 2.5.43.

fmask=value
   Set the umask applied to regular files only.  The default is the
   umask of the current process.  The  value  is  given  in  octal.
   Present since 2.5.43.

It all depends on how you want to control access. You could set the
gid and uid when mounting, and then set the umask to something like
umask=664 and put everyone you want to be able to write to the mount
in the group you set.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the fedora-list mailing list