I am currently following this guide to setup CentOS 8 to automount samba shares.
I am aware that we can change autofs auto mounted folders permissions using
uid=...,gid=...,file_mode=0770,dir_mode=0770
and it does technically work...
Here's my current setup, so my auto.master
contains the following
/mnt/smb /etc/auto.smb.top
auto.smb.top
* -fstype=autofs,-Dhost=& file:/etc/auto.smb.sub
auto.smb.sub
* -fstype=cifs,sec=ntlmv2,credentials=${HOME}/.${host}.smbpasswd,uid=${UID},gid=sambausers,file_mode=0770,dir_mode=0770,nounix ://${host}/&
with all the configuration above, /mnt/smb/192.168.x.x /shared_folder
does have the expected permissions, however the permissions for its parent directories /mnt/smb
and /mnt/smb/192.168.x.x
are owned by root
and does not follow the configuration from autofs.
I even tried to modify /mnt
(which is not auto created by autofs
)to the corresponding permissions but what happens is that the created smb
folder still is owned by root and does not follow the permissions at all of its parent directory. Did I miss anything in my configuration? I tried adding uid=...,gid=...,file_mode=...
to autofs.smb.top
, but the same issue persists.
with the current setup described above autofs makes the following
/mnt/smb
- owned byroot
/mnt/smb/192.168.x.x
- owned byroot
/mnt/smb/192.168.x.x/shared_folder
- owned bysambausers
(custom group I made)
but what I wanted was
/mnt/smb
- owned bysambausers
with0770
/mnt/smb/192.168.x.x
- owned bysambausers
with0770
/mnt/smb/192.168.x.x/shared_folder
- owned bysambausers
with0770