0

I have applied sticky bit on Samba share directory. Now client is not able to remove files and directories created by root of Samba server,

The issue is many clients access the same directory share by Samba server and they are able to delete each others files. I mean the file created by one client can be delete by other client.

How can I stop clients from removing each others files.

Dave M
  • 4,514
  • 22
  • 31
  • 30

2 Answers2

1

... apply sticky bit on samba share directory ... client is not able to remove files and directories created by root ...

The sticky bit on a directory only allows the owner of a file to delete that file.
If the root account is creating files in that directory, then only root can delete them.
This is exactly what the sticky bit is designed to do.

... many clients access the same directory ... able to delete each other files ...

Do you have the "force user" option set in the samba share configuration?
This would effectively give all files created through the share the same owner, regardless of the actual, end user that created them and, therefore, would allow the behaviour you describe.

Phill W.
  • 1,479
  • 7
  • 7
0

You need to set directory and file modes and/or access control list (ACL) entries so that the members of the group in question have rights to write (modify, delete) directories and/or files.

You need at least to chmod g+w <directory> for group members to be able to remove files from that dir. See also what umask does, e.g. try umask 02 before creating directories and files. Check permissions with ls -al.

For ACL (better, more flexible control) check linux ACL - look into getfacl and setfacl.

Zrin
  • 607
  • 1
  • 6
  • 14