Symas employee?Sign in

← Knowledge Base

Reference

Using ldapwhoami

Date: 11-04-2022

The ldapwhoami command serves two purposes:

  1. Test authentication
  2. Confirm the identity of the user that binds

Syntax

  `ldapwhoami  [-D bindDN (-w|-W)]`

We recommended you use simple binds (-x) and the -W (prompt for password) Option is used. The -w Option will retain the password used is stored in the shell's history

Examples

# Test if a password a user binding with is correct (successful result)
ldapwhoami -x -H ldap:/// -D "cn=May Gaul,ou=Accounting,dc=example,dc=com" -w secret
dn: cn=May Gaul,ou=Accounting,dc=example,dc=com
# Test if a password a user is binding with is correct (unsuccessful result)
ldapwhoami -x -H ldap:/// -D "cn=May Gaul,ou=Accounting,dc=example,dc=com" -w secrot
ldap_bind: Invalid credentials (49)
# See what identity the linux root user maps to with a SASL bind
ldapwhoami -Q -Y EXTERNAL
dn: dc=example,dc=com

For more information, please see ldapwhoami Man Page.