You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [ "$#" -ne 2 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Usage: $0 USERNAME HOSTNAME" >&2
exit 1
fi
USERNAME=$1
HOSTNAME=$2
BINDUSER="cn=Directory Manager"
BINDPW=DirManPassWord
LDAPHOST=ldap.example.org
echo \
"dn: uid=$USERNAME,ou=People,dc=example,dc=org
changetype: modify
delete: host
host: $HOSTNAME" \
\
| ldapmodify -c -x -ZZ -h $LDAPHOST -D "$BINDUSER" -w "$BINDPW" &>/dev/null && echo "Success! The $USERNAME account is no longer able to log in to $HOSTNAME." || echo "FAIL! $HOSTNAME was not locked."