Ubuntu 20.04 and ldap authentification

in flag

I struggle a little bit with setting up ldap authentification on Ubuntu 20.04. I followed this guide, that is, I installed the packages libnss-ldap libpam-ldap ldap-utils nscd.

nsswitch.conf looks

passwd:         files systemd ldap
group:          files systemd ldap
shadow:         files ldap
gshadow:        files

I changed the line in /etc/pam.d/common-password so that it reads

password [success=1 user_unknown=ignore default=die] try_first_pass

And I added the following line to /etc/pam.d/common-session:

session optional   skel=/etc/skel umask=022

Now I'm not sure about whether it is necessary that the user exists locally or not. If the user exists, everything works fine. If not, I get the following messages in auth.log:

Jan 27 07:06:55 myserver sshd[4479]: Invalid user myuser from xxxx:xxx:xxxx:xxx::xx port 50556
Jan 27 07:07:03 myserver sshd[4479]: pam_unix(sshd:auth): check pass; user unknown
Jan 27 07:07:03 myserver sshd[4479]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xxxx:xxx:xxxx:xxx::xx 
Jan 27 07:07:03 myserver sshd[4479]: pam_ldap: error trying to bind as user "CN=myuser,OU=Users,OU=TEST,DC=ad,DC=test,DC=example,DC=de" (Invalid credentials)
Jan 27 07:07:05 myserver sshd[4479]: Failed password for invalid user myuser from xxxx:xxx:xxxx:xxx::xx port 50556 ssh2

Am I doing something wrong, and the user should be automatically created (if not existing locally) or is it working as expected, and I have to create the users beforehand?


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.