Modifying permissions on automounted directories in CentOS6
Hello all,
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: Code:
/tsbackupshare /etc/auto.tsbackupshare --ghost Code:
obackups -fstype=cifs,gid=502,rw,guest,ip=10.17.x.x ://BackupDrive/OBackups Code:
$ ls -al /tsbackupshare Code:
drwxrwxr-x. 1 root dba 0 Feb 12 15:15 obackups 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. Thanks, John |
you are aware that CentOS 6.2 is unsupported and that all the software repos are now dead -- moved to the historical archive " The Vault"
please stay current and upgrade to 6.3 ASAP Code:
su - see Code:
man fstab |
Thanks for your response, John_VV. We are aware that 6.2 is out of date; thank you for your concern. What we're doing is actually part of our upgrade plan so that we can get up to the latest version of CentOS.
For future reference, I wanted to post here what I did to get this working. I tried adding the mask to override the default permissions that were being set. When I tried this, though, it didn't seem to have any effect. What got it working was using the dir_mode and file_mode options which are detailed in the man page for "cifs.mount." We're using a NAS and I guess the way that the NAS is implementing cifs doesn't support the cifs Unix extensions. Because of that, dir_mode and file_mode override the mode that is being set by default on the files and directories. Here is what our settings are: In our auto.master file: Code:
/tsbackupshare /etc/auto.tsbackupshare --ghost Code:
obackups -fstype=cifs,gid=502,rw,guest,ip=10.17.x.x,dir_mode=0775,file_mode=0775 ://BackupDrive/OBackups The first time that we ls the parent directory, we see this: Code:
$ ls -al /tsbackupshare/ we see the permissions get set correctly: Code:
$ ls -al /tsbackupshare/ Regards, John |
All times are GMT -5. The time now is 10:13 PM. |