How to get Linux users list from LDAP
We've just linked one of our Linux host to LDAP and ActiveDirectory. Now I'm trying to check how I get list of users and their details from within the Linux side.
You can achieve that by either typing in
getent passwd |less
or performing a LDAP search, such as
ldapsearch -x -LLL uid=*
(assuming that the bind DN and credentials are set in the ldap.conf file or you have read access to AD in other ways).
If you want to check if your Linux sees the POSIX entries from a LDAP server, use
getent passwd
The output should display entries both from local /etc/passwd
and LDAP server. If you are wondering how to get to the point, when there's something to check, this may prove to be a good starting point.