Samba and linux file permissions

  

Frequently encountered samba shared directory does not have permission to read or write, so I specifically did some experiments on file permissions. Found:

1. To access a file, the user must have x permissions on their "all" upper directory.

2. When creating a file, the user only needs to have the w permission for the directory in which it is located, and it does not matter whether the other upper directory has the w permission.

If samba is shared by security = share, then the default user is nobody, so generally give this user permission.

I have to mention the problem that once caused me to be very upset. I don't know if any of my classmates have encountered it. It is clear that all directories and files are 777 permissions, but I can't write them. Why?

This time you need to check the smb configuration file.

[home]

comment = Home Directories

path = /home

browseable = yes

writable = yes

[root]

comment = Root Directory

path = /

browseable = yes

writable = no

The above configuration, if accessed through the virtual directory root, because writable=no, it can not be written regardless of the directory and file permissions. It is necessary to change to the virtual directory of home.

Copyright © Windows knowledge All Rights Reserved