File permissions seem ok but users can delete other users files
jas88 at cam.ac.uk
Wed Aug 2 06:30:08 GMT 2000
On Wed, 2 Aug 2000, Adam wrote:
> Hi all,
> The network here is all NT workstations. There is an NT server 4.0 and a
> Redhat 6.2 machine running samba 2.0.7.
> I have a problem with samba where users cant read or write to other users
> files but they can delete them. I want to prevent users from deleting other
> users files. Each user has an account on the linux machine and on the NT
> machine. The linux ownership of each file is correct prior to delete and perms
> are 600, yet other users can delete them through samba.
> A file listing example is below:
> -rw------- 1 test1 test1 456 Aug 2 08:07 file1
> -rw------- 1 test2 test2 456 Aug 2 08:08 file2
> The only way I could prevent the deletion was to "chmod 000" but obviously
> that is of no use.
> Has anyone got any ideas how to fix this??
Deleting a file is controlled by the permissions on the DIRECTORY, not the
file itself: If I have write permissions to the directory, I can delete
any files in it. That's how Unix file permissions work...
To avoid this, set the "sticky" bit on the directory. This will prevent
users deleting files owned by other users, which appears to be what you
want? Use "chmod +t ." to set this.
Alternatively, give each user a directory, owned and writable by them.
That way, they can't interfere with each other.
More information about the samba-technical