I am working on a file server project for school and I am using samba to share the folders. I have been playing around with the folder permissions but I can't seem to figure out how to make a drop only like folder. This is what I want to achieve:
- Owner (server account): Full control
(chmod number 7xx)
- Group (users that sign in to the samba server) : Only place (drop) files,so this means don't open/edit/delete files in the folder
(chmod number x?x)
- others : no access
(chmod number xx0)
I have tried a lot of different chmod settings but never achieved the wanted result. Is this even possible? I googled a lot but couldn't really find a concluding answer.
Maybe a way to set permissions on files whenever they are placed in the folder?
If you need more information about the samba configuration or anything else please ask!
Thank you for helping out!
Best Answer
Try this procedure.
Create shared folder and give right permission:
This gives no access to other.
This mode, according to chmod manual page:
As told by Marty Fried files created in the share folder should have the right permissions and this can be achieved with samba share masks in
smb.conf
:Windows programs shouldn't try to remove read-only files unless
delete readonly
option is set to yes.Also if you want to hide all file in share folder:
According to samba manual these directive:
After this configuration, the only problem left is that user can still delete his/her own files even if he/she do not see it (It is unclear to us why).
So we decide to follow the_Seppi suggestion to complete the task and Bram Driesen did a script that changes file ownership to the host pc.
He used
incron
to fire the script whenever a file is placed in the folder, following this as guide to set it up.