1

My server is running redhat and has two users A and B,

User A ownes /dirA

Now I have created /dirA/dirB and did

chown -R B:B /dirA/dirB/

when I su B and cd /dirA/dirB/ it workes fine. But when I directly login from user B and cd to above mentioned directory, I get "Permission Denied"

1 Answer 1

0

su

and

su -

will produce much different results. su - will read in the environment of the new user replacing the prior environment. su will merge them.

check your identity with the

id

command and you may discover why you have permissions. It could be that you retained a group membership that allows you access.

2
  • Problem is not why user B can access, it's why user B cannot access when B has ownership of the directory
    – ivcode
    Nov 25, 2014 at 7:47
  • A user may belong to several groups. If user B does not have identical group memberships, as identified by the id command, then look for a directory in the path that impedes the user. A folder in the path that does not have read and or execute (search) permissions can impede a user. *nix permissions are very straightforward. When logged in as the user with the defect, start at / and cd folder by folder and do an ls. This may help find the folder that is giving this user a problem. Then look at the id's in relation to the folder owner/group and check /etc/group.
    – AngelaS
    Nov 25, 2014 at 14:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .