1

Note: Username modified for public post.

I have a linux server on which I have root privileges. There is a user account "privuser" which can only be SSHed into using SSH keys. But, due to some user changes, privuser cant read his own directory anymore. Neither can I in-spite of being root!

[root@server ~]# id privuser
    uid=29772(privuser) gid=509(abc) groups=509(abc),1519(ghi)

[root@server ~]# groups privuser
privuser : abc ghi

[root@server ~]# su - privuser
su: warning: cannot change directory to /usr/home/xyz/abc/privuser: Permission denied
Your password expires on never
-bash: cd: /usr/home/xyz/abc/privuser: Permission denied
cannot cd to home directory /usr/home/xyz/abc/privuser
-bash: /usr/home/xyz/abc/privuser/.bash_profile: Permission denied
-bash-4.1$ exit
logout
-bash: /usr/home/xyz/abc/privuser/.bash_logout: Permission denied

I cant see those files even as Root.

[root@server ~]# ls -alh /usr/home/xyz/abc/privuser/
ls: cannot access /usr/home/xyz/abc/privuser/: Permission denied

However, /usr/home/xyz/abc/privuser is an NFS mount, so I can check from directly on the NFS server that, the directory and files are indeed owned by that UID.

How do I find out what is going on here?

EDIT: (Adding ls output)

testuser is another user in the server belonging to the same group - abc as the trouble making user(privuser), and here is what I can ls from testuser.

[testuser@server ~]$ ls -alh /usr/home/xyz/abc/
total 196K
drwxr-s--- 37 root       xyz     4.0K Nov  2 15:47 .
drwxr-xr-x  9 root       root    4.0K Feb  1  2016 ..
drwx------  5 testuser   abc     4.0K Nov 29 14:12 testuser
drwxr-xr-x 13 privuser   abc     16K  Jan  4 21:05 privuser
.....

testuser, belonging to the same group abc can see the files of privuser.

testuser@server ~]$ ls -alh /usr/home/xyz/abc/privuser
total 124K
drwxr-xr-x 13 privuser abc      16K  Jan  4 21:05 .
drwxr-s--- 37 root     **xyz**      4.0K Nov  2 15:47 .. <========== !!
drwxr-xr-x  2 privuser abc      4.0K Jan  4 12:38 arkiv20180104
-rw-------  1 privuser abc      15K  Jan  4 21:05 .bash_history
-rw-r--r--  1 privuser abc      99   Jan  4 12:31 .bashrc
drwxr-xr-x  3 privuser abc      4.0K Jan  4 12:42 .conda
drwx------  2 privuser abc      4.0K Jan 23  2017 .ssh
....

Solution: privuser did not belong to the group xyz in spite of its home directory being located in a directory owned by xyz. I added privuser to the xyz group and the permissions problem went away.

  • Has you NFS server been configured to allow access from the uid/gid in question? It may also be an idea to check any log files on the NFS server if possible. – Raman Sailopal Jan 24 '18 at 15:21
  • The NFS mount /usr/home/xyz/abc/ is served by a NetApp filer, and other directories in the same mount, for example - /usr/home/xyz/abc/test/works just fine.I'll try to tail the logs there.. – Aravindh Sathish Jan 24 '18 at 15:26
  • ls -l of the previous folder? – Kevin Lemaire Jan 24 '18 at 15:49
  • @KevinLemaire Thanks for the suggestion. I noticed the oddity in the ls output and solved my problem by adding the user to group xyz. – Aravindh Sathish Jan 24 '18 at 16:27
  • You’re welcome. Don’t hesitate to post your solution as an answer. You can answer your own question. – Kevin Lemaire Jan 24 '18 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.