Skip to Content

sshd[902]: debug1:PAM: password authentication failed for an illegal user: Authentication failure

If you are getting the error when you configured pam_ldap for the backend ssh authentication.

Ensure to uncomment following lines in /etc/ldap.conf

# RFC 2307 (AD) mappings
nss_map_objectclass posixAccount user
#nss_map_objectclass shadowAccount user
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory

 Restart the nscd service.

service nscd restart

 The following commands should now return a result from AD/LDAP.
[email protected]:~# getent passwd james
[email protected]:~# finger james
Login: james                      Name: james
Directory: /home/james                  Shell: /usr/local/bin/ezsh
On since Thu Feb  1 14:23 (IST) on pts/1 from
   1 hour 47 minutes idle
No mail.
No Plan.