Samba: protect write-enabled directory-tree for move or delete
Hi there,
I have a write-enabled Samba-share with a directory-tree (created by a script) that I would like to protect. The users should be able to read, write (edit, delete, create new files on all depths, create (unprotected) sub-directories) but not to alter the protected tree (i.e. delete or move folders). Does Samba offer the possibility to do that? I have tried to set the Windows-side attributes in a way to achieve that (give write privileges, but not delete ones), but I just get an "permission denied"-error. running Samba 3.0.28 Thanks Alex |
Yes, you can set samba shares to have special permissions. Here are the examples from the smb.conf.example:
Code:
#============================ Share Definitions ============================== -weisso |
You can create your directory structure like this:
sudo mkdir -p /srv/samba/share/{subdirectory1,subdirectory2} sudo chmod rwxt /srv/samba/share/{subdirectory1,subdirectory2} The "t" is what makes the directories sticky. Make sure to make the directory and the subdirectories you want protected sticky. The owner of the directory will be able to delete files inside, but another user will not be able to. If the owner is root that wouldn't be a problem. |
Thanks, thats exactly what I had in mind. I use this script to create my protected directory trees:
Code:
sudo mkdir '$new_dir' |
All times are GMT -5. The time now is 04:17 PM. |