Permission denied on first access when login in over SSH and NFS is used

Solution Unverified - Updated -

Issue

The home directories of the users are created by the NFS with automounter. During the first attempt to access the home directory there is an error

"Could not chdir to home directory /storage01/nethomes/user: Permission denied"

and user was dropped to root directory.

But in fact it's possible to chdir to that home directory:

    ssh user@server1
    user@server1's password:
    Last login: Fri Nov  4 16:16:41 2011 from client1.example.com
    Could not chdir to home directory /storage01/nethomes/user: Permission denied
    -bash-4.1$ pwd
    /
    -bash-4.1$ cd
    -bash-4.1$ pwd
    /storage01/nethomes/user
    -bash-4.1$

At the same time the "permission denied" error is appeared on screen, this message is also logged to /var/log/audit/audit.log:

    type=AVC msg=audit(1320770440.745:37260): avc:  denied  { search } for  pid=3959 comm="sshd" name="storage01" dev=dm-0 ino=2621442 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:default_t:s0 tclass=dir

Environment

  • Red Hat Enterprise Linux 6
  • homedirectories in NFS

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.