1

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?

2 Answers 2

2

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.

2
  • Our windows servers are using active directory. Our linux servers are using OpenLDAP and the goal is to eventually move everything to use OpenLDAP groups to secure windows shares. So, I guess maybe the next step is to configure the Windows Box to use OpenLdap. If windows was using OpenLdap, then I'm assuming I could use your advice and use same OpenLdap groups everywhere? Sep 13, 2011 at 20:18
  • Dealing with LDAP is a whole different beast that I don't feel qualified to remark on--but my understanding is that you should be able to adapt samba and pam to digest your ldap data however you want it organized. But the real key here is doing your system authentication with samba if you want your heterogeneous environment to work well. You need to get your linux machines on the windows domain (or vise-versa, if you plan to have samba run your domain) Sep 13, 2011 at 20:55
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .