Ubuntu – How allow both local login and LDAP on Ubuntu

ldappamUbuntu

I have configured LDAP and it works incredibly fine. However if the network is down, there is no one to use a machine, even if a local user is registered. Is it possible to allow local users to login when LDAP is not reachable? Or allow both LDAP and local authentication?

/var/log/auth.log has this:

Oct 27 11:30:36 trento lightdm: PAM adding faulty module: pam_kwallet5.so
Oct 27 11:30:36 trento lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "localadmin"
Oct 27 11:30:39 trento lightdm: PAM unable to dlopen(pam_kwallet.so): /lib/security/pam_kwallet.so: cannot open shared object file: No such file or directory
Oct 27 11:30:39 trento lightdm: PAM adding faulty module: pam_kwallet.so
Oct 27 11:30:39 trento lightdm: PAM unable to dlopen(pam_kwallet5.so): /lib/security/pam_kwallet5.so: cannot open shared object file: No such file or directory
Oct 27 11:30:39 trento lightdm: PAM adding faulty module: pam_kwallet5.so
Oct 27 11:30:39 trento lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "ldapuser"
Oct 27 11:30:41 trento lightdm: pam_unix(lightdm:auth): authentication failure; logname= uid=0 euid=0 tty=:1 ruser= rhost=  user=ldapuser
Oct 27 11:30:41 trento lightdm: pam_unix(lightdm-greeter:session): session closed for user lightdm
Oct 27 11:30:45 trento systemd-logind[857]: Removed session c20.

Best Answer

Yes it is possible and is the default for Ubuntu. Did you configure PAM by hand? Here is what Ubuntu uses in /etc/pam.d/common-auth:

auth    [success=2 default=ignore]      pam_unix.so nullok_secure
auth    [success=1 default=ignore]      pam_ldap.so use_first_pass
auth    requisite                       pam_deny.so
auth    required                        pam_permit.so

The first line allows local authentication.