drwxrwxrwx 2 user1 user1 4096 Jun 21 11:25 .
drwxr-xr-x 16 user1 user1 4096 Jun 21 11:25 ..
-rw-r--r-- 1 user1 user1 15 Jun 21 11:25 access.txt
The file access.txt is owned by user user1 but the directory has open access to the world (777).
If I log in with user2, I can delete access.txt even though user2 does not have write permissions to it. So does directory permissions take precedence over file permissions? Perhaps that not the best way to describe it, but just looking for a basic explanation here.
access.txt
because you have write permission to the directory. You could remove that file even if it belonged toroot
. – Arkadiusz Drabczyk Jun 21 '19 at 18:42