Skip to content

Instantly share code, notes, and snippets.

View nicktruch's full-sized avatar

N. Truchaud nicktruch

  • Université Jean Monnet
  • Saint Etienne
  • 19:22 (UTC +02:00)
  • X @nicktruch
View GitHub Profile
@stefanschmidt
stefanschmidt / authenticate-ldap.sh
Last active June 5, 2024 07:17
Authenticate via LDAP on the command line
# Using an LDAP test server we will authenticate the user newton
# http://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/
# method 1: using ldapwhoami
# should return "Result: Success (0)" if authentication was successful
ldapwhoami -vvv -h ldap.forumsys.com -D "uid=newton,dc=example,dc=com" -x -w password
# method 2: using ldapsearch
# should return "result: 0 Success" if authentication was successful
ldapsearch -h ldap.forumsys.com -x -D uid=newton,dc=example,dc=com -w password -b "dc=example,dc=com" "(uid=newton)"