Okay so I have Samba running on my server and I have noticed that it can't display folder contents unless the folder is set with chmod 700 to give rwx attributes to everything instead of just rw with chmod 600. I'm curious as to why that is. I have several folders that have media in them and I would like to set those using "chmod -R 644" which from what I understand will give the owner read/write access and everyone else read only access. If I use those settings though, when I log in with samba (both my Linux username and Samba username are the same) it says the folder is empty.

Here is my smb.conf

    writeable = yes
    force directory mode = 744
    valid users = jack,kodi,technovore
    case sensitive = yes
    user = jack,kodi,technovore
    force create mode = 744
    create mode = 744
    comment = Root 3TB on IACON
    delete readonly = yes
    path = /media/3TB

If I use the attributes for the Movies folder, then everything is fine, I could even use 700 instead of 777. However if I use the set for TV it will show the folder but not the contents. 777 vs 644. Can someone explain why this is happening?

Folder Attributes


The execute bit on a directory is used to allow the user to descend into the directory (traversal). If you do not set the execute bit you will not be able to read or manipulate the contents of the directory. By default a directory permissions is 0775. This means everyone can see and manipulate the files therein. The files created have the default permissions of 0664. This means that the user and group have read and write while all others have read permissions.

The exception to this is the root users creation permission settings. These are 0755 for directories and 0644 for files. This still allows all users to view the files in the directory while only allowing the root user read and write permissions.

You need to allow the user to access the directory with the directory permissions and the ability to manipulate the files with the file permissions.

This needs to be set initially on the shared directory. Then you can provide for the share file and directory creation permissions with this [share] ... create mask = 0664 directory mask = 0775

The create mask is for the file permissions and the directory mask is for directory permissions. Since all permissions are defined by the most recent umask setting you can consider the mask configurations as Samba's umask settings for the share.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.