• Contact Us
  • Home
  • Reference

Using ldapwhoami

Learn how to use the ldapwhoami command to retrieve current user details and connection information from an LDAP server - a vital tool for system administrators.

Written by Maryanne Normann

Updated at March 2nd, 2026

  • Quick Start
  • Installation
    Best Practices Configuration Troubleshooting Design Performance Platform
  • Maintenance
    Releases Upgrade
  • Reference
+ More

Table of Contents

Syntax Examples

Date: 11-04-2022

The ldapwhoami command serves two purposes:

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

Syntax

  `ldapwhoami <opts> [-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.

Copyright © 2020-2024 Symas Corporation. All rights reserved.
utility ldapwhoami cli

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Chaining Overlay with Keep Alive Function
  • cn=monitor Reference
  • Common ldap Command Parameters
  • Common slapd Command Parameters
  • Convert Single-Master to Multi-Master Replication
  • Symas Blog RSS Feed
  • Symas on Facebook
  • Symas on Twitter
  • Symas Blog
  • Symas on LinkedIn
  • Symas YouTube Channel

Copyright © 2025, Symas Corporation. All rights reserved. Privacy Statement (updated July 31, 2023)

Phone:

Main Office: +1.650.963.7601
Fax: +1.650.390.6284

Email:

Sales: sales@symas.com
Support: support@symas.com

Office Hours:

8:00 AM - 5:00 PM ET

Office Location:

Symas Corporation
PO Box 391
Grand Junction, CO 81507 USA

Expand