I have many servers over 50. earlier we were using that LDAP authentication. Now we have decided to go to same username needs to be authenticate locally on server rather than LDAP authentication. something has messed up and we loose track there we have change the authentication scheme. Now I need to manually log in to all server and check. What is the fool proof way to check whether user account is authenticated locally or through LDAP ? PS: I have tried checking /etc/passwd file for user name but it's not working. though entry is there, user account is authenticated through LDAP :(
2 Answers
getent passwd "username"
Copy the result into the buffer
vipw
Paste the line into it. Either at the end or at the right place.
getent shadow "username"
Copy the line again
vipw -s
Paste the line into it. Then use
passwd "username"
to set the password itself again. 'getent' won't give you the encrypted LDAP password.
I'm not sure exactly what you're asking, but changes like that are handled in /etc/nsswitch.conf. Look for the users section in that file, that should tell you if it's local (files) or ldap.