I'm on a CentOS 6.2 box and I've been playing around with setting up autofs to automount a shared directory from a NAS. I've got a question about the permissions that are set on directories which are automounted by autofs and if it's possible to change them. After automounting the directory, the mount point directory is always assigned the permissions of 755. Is it possible to get these permissions changed somehow to 775? Here is my config:
I am mounting a shared directory from a NAS using cifs. Here is what's in my /etc/auto.master file:
/tsbackupshare /etc/auto.tsbackupshare --ghost
Here's what's in my /etc/auto.tsbackupshare file:
obackups -fstype=cifs,gid=502,rw,guest,ip=10.17.x.x ://BackupDrive/OBackups
When the share is mounted, here are the privileges that it has:
$ ls -al /tsbackupshare
drwxr-xr-x. 3 root root 0 Feb 12 16:12 .
dr-xr-xr-x. 26 root root 4096 Feb 12 16:12 ..
drwxr-xr-x. 1 root dba 0 Feb 12 15:15 obackups
What I'm going for is to have something where I could have multiple users assigned to the dba group and this directory would be automounted and they could have read/write permissions to this directory. So I'd like to have permissions like this:
drwxrwxr-x. 1 root dba 0 Feb 12 15:15 obackups
As it is now, users in the dba group can only read from the directory. One possible path is to use the "uid=" parameter to assign one of the users from the dba group as the owner and then one of the users can write to the directory but none of the other users of the group can write to the directory. But I don't want only one user to be able to write to this directory. I don't see the purpose of assigning a group if the group will only have the same permissions as "others". That doesn't make too much sense so I figure there's got to be a way to assign read/write privileges to the group too; I just don't know how to do that yet (hoping it's possible).
I've searched all over the internet to try to find a solution to this. I found one suggestion to "pre-create" the directories, assign the permissions that you want, and then they will be carried over after autofs mounts the directory. No matter what, though, permissions are reset after autofs mounts the directory (which is, I guess, to be expected).
Is there any way to control what the permissions are set as with autofs? It seems like the only solutions is to let only one user have read/write access.
I really like the concept of autofs and I'd prefer to use that over an entry in /etc/fstab because I like how automount will umount the directory after a period of non use. Any help would be greatly appreciated.