0

In Linux, let us assume we have a directory with the following properties:

drwx---r-x 29 user1      group1 4096 Jun 22 14:11 dir1

can I, as user2 having group group1, navigate into dir1?

Since other has r and x permissions, I was thinking I could, but I could not navigate into the directory and got the following error:

-bash: cd: dir1/: Permission denied

What am I missing?

1 Answers1

1

The permissions for group take priority over permissions for other. And in turn, permissions for user take priority over both. You're not the owner but you are in group1, so those are the permissions that are checked.

Generally, permissions rarely become less restrictive when going from user to group to other. In your scenario, if you want members of group1 to have the same access to this file as everyone else you need to give them the same permissions: rwxr-xr-x.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287