0

I have three users jack, hugo and kate (standard users).

jack's group membership is: jack , eng_g

hugo's group membership is: hugo , eng_g

kate's group membership is: kate

jack and hugo both belong to secondary group, eng_g.

I created an "staff_eng" folder as admin in /home and changed its group.

ls -l for this folder is:

d rwxrwxr-x root eng_g staff_eng

Now, as jack, I went to “staff_eng” folder (cd /home/staff_eng) and created a file "kate_file".

ls -l for this file is:

-rwxrw-r-x jack jack kate_file

(I don't know why group name is jack but not eng_g).

I changed file’s ownership to kate. Now, ls -l for this file is:

-rwxrw-r-x kate jack kate_file

Now, kate is the owner of this file, but kate does not belong to eng_g group.

As user kate, I can read and change file "kate_file", because I can access to “staff_eng” directory as indicated by others permission. But as an owner, I can't detele "kate_file". Why? Is it because kate doesn’t belong to eng_g group? What about ownership of file? Kate owns file but can’t remove it?!

please explain this situation clearly

P Zia
  • 1
  • 1
  • 1
    In order to delete a file, a user needs write access, not to the file itself, but to the directory in which it resides: this may be granted through user, group or other permissions. Execute permission on a directory allows it to be part of a file path, but write permission is needed to modify the directory, ie create, rename or delete a file in it. – AFH Jun 17 '19 at 11:33
  • 1
    @AFH Please do not confuse the comment form with the answer form. – u1686_grawity Jun 17 '19 at 11:48
  • @grawity - I'm not confused: I like to verify through comments that I have understood the problem correctly before I commit to an answer. – AFH Jun 17 '19 at 12:01
  • Possible duplicate of [How come one user can delete another user's 755 files?](https://superuser.com/questions/834948/how-come-one-user-can-delete-another-users-755-files) – Kamil Maciorowski Jun 17 '19 at 12:06

0 Answers0