Linux - group member cannot delete file with rw permission
Solution 1:
First, you're looking at the wrong permissions. When you move/rename/delete a file, you're only modifying the parent directory – the file's own permissions are not checked. You only remove an entry from the directory's list of files. Therefore you should check the permissions of the parent directory (in this case /tmp
).
$ ls -ld /tmp
drwxrwxrwt 15 root root 460 Jul 19 15:18 /tmp/
Second, /tmp
is special. On practically all systems, it's writable by anyone (ugo=rwx
), so at first glance, it looks like anyone could rename or delete any file in it. This would of course make it easy (well, even easier) to create problems for other users, therefore /tmp
always has the "sticky" aka "restricted deletion" mode set (o+t
). With this mode set, only the file's owner can move or delete files in that directory, regardless of any permissions.
(On GNU coreutils, the chmod(1)
manual page has a section about the "restricted deletion flag or sticky bit".)