I've mounted a shared windows directory (C:\foo\bar) on an ubuntu server (/mnt/shared/bar) like so:
//windows-server/bar /mnt/shared/bar smbfs credentials=/etc/samba-credentials 0 0
It works great, but when I cd into /mnt/shared/bar, Ubuntu shows that all the files are owned by root.
I'd like to restrict access to /mnt/shared/bar on the linux side. For example, I'd like to only allow users in the "baz" group to have access to the /mnt/shared/bar directory.
I'm new to Samba. Can someone with more experience let me know if this is possible?
If you were using CIFS instead of SMBFs, using ACL's and Samba's PAM module you would be able to use the proper ACL's from the physical file server. It may seem like a big change to your linux host, but it's worth it, that is assuming you're using active directory.
Specifying the
gid
will map the share ownership to that group.To find the gid:
getent group baz | cut -d: -f3
New command:
//windows-server/bar /mnt/shared/bar cifs credentials=/etc/samba-credentials,gid=<baz gid> 0 0