Enabling LDAP on Linux and local user’s session will interchange with LDAP’s user intermittently

Let’s say you have a central authentication server in a LDAP and you successfully connect your Linux box as a client to LDAP server. Whenever you are using a particular LDAP user to login to your box, your shell get confused and change the LDAP user with a local user of your box intermittently. What is the problem?

for making it crystal clear lets say your local user ID is : 1000 for knowing the id of user in Ubuntu you can run following command :

id

And this will print out uid, gid and the group id of the user.

Now if you go to your LDAP server and query the same user name  you will notice that his LDAP’s uid is also the same as the local user id 1000.

for solving this problem you either have to change local uid or LDAP uid.

After configuring Ubuntu to use LDAP ssh login become too slow

This is a common symptom of mis behaviour of systemd-logind. I couldn’t still find-out what is really happening underneath of this service but if you experience such issues you can try to restart the service using following command

sudo service systemd-logind restart

and make sure to run this code on the console not just by using ssh.

If anyone knows more about underlying components of systemd-logind please give me some more information about it.