su: warning: cannot change directory to /ldapuser/home/user2: No such file or directory
Hi I tried configuring autofs in both RHEL 7 & 7.2 on the client for ldap user with NFS home directory, but unable to mount the home dir neither with ssh / su
Please suggest
[root@ldapclient~]# su - user2
su: warning: cannot change directory to /ldapuser/home/user2: No such file or directory
mkdir: cannot create directory '/ldapuser': Permission denied
-bash-4.2$
-bash-4.2$ id
uid=3002(user2) gid=3002(user2) groups=3002(user2) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-bash-4.2$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
[root@ldapclient~]# getent passwd user2
user2:*:3002:3002:user2:/ldapuser/home/user2:/bin/bash
[root@ldapclient~]# cat /etc/auto.master.d/home.autofs
/home /etc/auto.home
[root@r7nyknode ~]# cat /etc/auto.home
* -fstype=nfs,rw,sync ldapnfsserver.example.net:/ldapuser/home/&
=============================
LDAP + NFS Server
[root@server1~]# exportfs -v
/ldapuser/home 192.168.7.0/24(rw,wdelay,root_squash,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)
Responses
Anthony,
Can you confirm you can manually mount /ldapuser/home/user2? ie. that the NFS server is correctly configured and server1 has access to mount?
Is autofs service running? and have you restarted it since your configuration changes?
For me, I had the below output while logging into a server using ldap user. su: warning: cannot change directory to /home/ldap_uder: No such file or directory
I did add below entry to /etc/pam.d/system-auth session optional /lib/security/$ISA/pam_mkhomedir.so
And it worked. Hope it helps for someone who is having similar issue. Thanks!
Regards, Amit Saha
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
