Skip to content

Instantly share code, notes, and snippets.

@zushane
Last active April 8, 2016 22:00
Show Gist options
  • Select an option

  • Save zushane/a38f156823b5c90dcfe6ada6dea80c9c to your computer and use it in GitHub Desktop.

Select an option

Save zushane/a38f156823b5c90dcfe6ada6dea80c9c to your computer and use it in GitHub Desktop.

Revisions

  1. Shane Doucette revised this gist Apr 8, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion change_ldap_password.sh
    Original file line number Diff line number Diff line change
    @@ -11,5 +11,5 @@ 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
    ldappasswd -h $HOST -x -D $ROOT_DN -W -S $USER_DN

  2. Shane Doucette revised this gist Apr 8, 2016. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions change_ldap_password.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,10 @@
    #!/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}"
  3. Shane Doucette created this gist Apr 8, 2016.
    10 changes: 10 additions & 0 deletions change_ldap_password.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/bin/bash

    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