Wednesday, August 7, 2013

[Linux] file_mode, dir_mode or permission not working correctly in Samba Share or Mount folder

Users permission in Linux is really complicated, for samba share, you need to take care:

  1. the folder permission of the parents folder where your samba share is located (at server side)
  2. the folder permission of the parents folder where your fstab mounted folder is located
  3. the create mask and directory mask in /etc/samba/smb.conf on your server
  4. the file_mode, directory_mode, nopermrw and credentials in your /etc/fstab on client PC
General rules are parent folders permission will always overwrite the smb.conf & fstab

When do I need to check the parents folder permission?
  1. If you have set everything in both files and still cannot get the correct permission for new created file/directory in your samba shares. Check client PCs mount folder's parent's permission
  2. If client PCs has problem access the samba shares, even with the correct username & password entered. Check server samba share parent's folder permission
  3. When you need valid users = xxx, xxx to give access to client PCs. Check server samba share parent's folder permission
I have set the samba/fstab/parent folder permission, but I still don't have write permission?
  1. you need to add uid=***your current user name*** at the fstab mount option.
Known Issue
  1. When creating file/directory in the mount folder (using Ubuntu 12.10), it does not honor the create mask & directory mask set by the server's smb.conf. I'm still looking for a solution... appreciate if anyone can help.

No comments:

Post a Comment