i have a folder called Public inside my home folder. I need to share this folder (write only) via samba. However if i chmod 772 Public it doesn't work since my home folder is 750. Is there a way to solve this without chmod 777 my home folder?
You could use the
force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.
Without knowing the details of your requirement there's little point suggesting more complex alternatives.
To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the
x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless
r was also in effect).
For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be
wx, and all parent directories should have at least
If you are creating a "drop box" in your home directory, therefore:
cd mkdir directory chmod o=wx,g=wx directory chmod a+x "$HOME"
Note that I'm also giving the group
wx access to the directory here (rather than using
g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though
o=wx was in effect.
Assuming you as the owner has
rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.