Skip to content

Instantly share code, notes, and snippets.

@zushane
Last active April 8, 2016 22:00
Show Gist options
  • Save zushane/a38f156823b5c90dcfe6ada6dea80c9c to your computer and use it in GitHub Desktop.
Save zushane/a38f156823b5c90dcfe6ada6dea80c9c to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "Usage: $(basename $0) user"
exit 99
fi
HOST=ldap.example.com
BASE_DN="dc=example,dc=com"
ROOT_DN="cn=admin,${BASE_DN}"
USER_DN="uid=${1},ou=Users,${BASE_DN}"
echo "Changing password for $1."
ldappasswd -h $HOST -x -D $ROOT_DN -W -S $USER_DN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment