0

On a CentOS 7 machine, users can use their LDAP credentials to connect to my servers. The first time they do this, the pam_mkhomedir is doing its job well. The user's folder /home/jdoe is well created with the right permission.

The issue is that when Joe connects to my server, using SSH or directly on the server monitor (just to say that it's not only a pam.d/ssh issue), its shell doesn't start in his home directory. Instead, it starts on "/home" or "/" directory.

The $HOME is the right one, if Joe does a "cd", the shell goes to "/home/jdoe" and the HomeDirectory in LDAP is the right one.

/etc/pam.d/sshd content:

#%PAM-1.0
auth       required     pam_sepermit.so
auth       substack     password-auth
auth       include      postlogin
# Used with polkit to reauthorize users in remote sessions
auth       optional     pam_reauthorize.so prepare
account    required     pam_nologin.so
account    include      password-auth
password   include      password-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    required     pam_loginuid.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open env_params
session    required     pam_mkhomedir.so
session    required     pam_namespace.so
session    optional     pam_keyinit.so force revoke
session    include      password-auth
session    include      postlogin
# Used with polkit to reauthorize users in remote sessions
session    optional     pam_reauthorize.so prepare

Anyone know how to help me to find the solution ?

locobastos
  • 15
  • 1
  • 1
  • 8
  • Ok, let's add more information. -root user has the same issue. -I've added an echo in ~/.bashrc, when the user login, the echo is not shown; when he writes bash, the echo is shown; it looks like the bash is not started with user environment. -In PAM debug log, I've `pam_unix(sshd:session): session opened` then `pam_unix(sshd:auth): authentication failure`. – locobastos Nov 24 '21 at 09:25
  • On a CentOS 6 server, in which my user does not have my issue, I've the same pam_unix log. It means that this is not the root cause. – locobastos Nov 24 '21 at 10:30

0 Answers0