user1 and user2 are both members in group gr1. Assume user1 run the following commands:
$ who am i
user1 pts/7 Oct 20 10:02
$ ls -ld /home/user2/info
drwx-----x. 2 user2 gr1 4096 09-20 09:31
/home/user2/info
$ ls -l /home/user2/info
ls: /home/user2/info: Permission denied
Explain why user1 got permission denied?
Here you go:
In Linux, ownership of Linux files has its own set of
rules.
Whenever a user creates a particular file, the user will become its
owner by default. But in a group, all the users which belong to a
group will have the same access rights to the file.
Now if you change the access permission of any file (or say user2
in the above case) it automatically applies the new access
permissions to all the users who come under that particular group.
Hence the permisson got denied.
========================================================
A sign of thumbs up would be appreciated.
Get Answers For Free
Most questions answered within 1 hours.