Centos – Mount issues with Samba under non-root user

centosdebianlinuxsamba

Maybe someone can shed some light here as I'm confused.

I have this setup:


Server 1 (CentOS File Server)

  • Shared directory /file/to/www/share (owned by web-user:web-user)

  • Samba user "web-user" added

Server 2 (Debian Web Server)

  • Mounted //[server]/[share] to /mnt/www_share

  • Server has local user "web-user:web-user"


Now, (as root) I can access the share and Read/Write/Execute.

Though, no other users can Write (only Read/Execute).

I've tried setting the directories to 777, setting the umask in Samba to 000. I cannot mount to the share as non-root.

Any ideas?

Thanks

Best Answer

Unlike NFS (which, BTW, should have been your choice for Linux to Linux mounting), SMB doesn't automatically share user authorizations across the protocol - at least not without a complicated "Active Directory" setup.

What you probably want to do (other than change to a protocol that does share some user details, such as NFS), is to mount the directory using the required user permissions, using the uid and gid options of the mount command or fstab file.

Use man fstab, man mount (the smbfs section) and man smbmount for more details.

You might also be interested in investigating the fmask and dmask options.

Related Question