Can someone please explain how is user "saad" able to delete the files/folders created in /project directory by root user. Saad user is the owner of folder /project. The owner and group owner of all these files/folders inside the /project is root as we can see. And for the other users either it is no permission or it is read only or read-execute for some. No files/folders have user saad as the owner.
Once the user saad cd inside the /project folder, the permissions applied to user saad will be from other user permissions ? Based on what privileges, user saad is able to delete all these files/folders.
[saad@localhost ~]$ ls -ld /project/
drwxrwxrwx. 8 saad devteam 94 Jan 16 06:55 /project/
[saad@localhost ~]$ ll /project/
drwxr-xr-x. 2 root root 6 Jan 10 16:41 dir1
drwxr-xr--. 2 root root 6 Jan 15 17:54 dir2
drwxr-xr--. 2 root root 6 Jan 10 16:41 dir3
drwxr-xr-x. 2 root root 6 Jan 6 17:23 dir4
drwxr-xr-x. 2 root root 6 Jan 6 17:23 dir5
drwxr-x---. 2 root root 6 Jan 16 06:54 dir7
-rw-r-----. 1 root root 143 Jan 10 17:19 file.txt
project
is owned by saad and this one haswrite(w)
permissions. When you applyrm
to a file the permissions of the parent directory allow/deny the deletion of this one. – Edgar Magallon Jan 16 '23 at 07:17dir/
aren't enough to delete files contained indir/subdir/
, and the latter directory needs to be empty to be removed. – ilkkachu Jan 16 '23 at 07:29dir/subdir/
to deletedir/subdir/file
to makedir/subdir
empty. And the same recursively. (Better think of thex
permission as "access" on directories since really it has nothing to do with execution) – ilkkachu Jan 16 '23 at 07:51