Users And Permission : Command Line

Screen Link:

I need some clarity on the file/directory persmission topic. For the question given below I have not understood the answers provided by DQ.

Second scenario: User learn owns a file whose permissions are rwxr-xr-x .

Question 3: Can dq modify the contents of this file? Answer is No
Question 4: Can dq rename this file? Answer is Yes

Here in this scenario if my understanding is correct, we have two users dq and learn. Now inside the learn directory we have a file with the permissions rwxr-xr-x. If we break it down then it’s as follows:
rwx : permission for the user which is learn but not for dq
r-x : permission for the group which is /home. Here my understanding is both the users dq and learn belongs to same group /home and hence these access are applicable to dq aswell.
r-x : the permission for the group other than /home as per understanding.

The answer to first question is No becasue the user though dq belongs to same group, the group permission is only r-x.
For the second question’s answer to be Yes, the directory where the file is saved, which is in this case learn should have write permission to group. But this is not clear from the given scenario.

Please throw some light on this.

I don’t understand your question. You begin by singling out questions 3 and 4, but end by talking about question 1 and 2.

I have no idea what you don’t understand or what you’re asking.

Sorry for that confusion. Here my focus is only on questions 3 and 4.
So by first question, I mean Question 3 and by second question, I mean Question 4.

I still don’t understand your question.

No, their home directories being in /home doesn’t imply they belong to the same group. One of the givens in that group ownership is the same as user ownership, meaning that the group owner of the file in the second scenario is learn.

So dq can’t modify the contents of the file because the permissions for everyone else (given by the last three characters) (are r-x and they) do not allow other users to modify the file.

I don’t understand what you’re saying, but you can see this topic.