Skip to content

Instantly share code, notes, and snippets.

@bendem
Last active August 26, 2021 11:30
Show Gist options
  • Save bendem/9dafd6d2972a080861bb09faaae2e9e5 to your computer and use it in GitHub Desktop.
Save bendem/9dafd6d2972a080861bb09faaae2e9e5 to your computer and use it in GitHub Desktop.
Some useful ldap commands
ldapsearch -LLL -o ldif-wrap=no -H ldapi:/// -Y EXTERNAL -b 'cn=config' 'olcAccess=*' olcAccess \
| awk '{
if ($1 == "olcAccess::") {
command = "base64 -d -i"; print $2 | command; close(command)
} else {
print $0
}
}'
ldapmodify -H ldapi:/// -Y EXTERNAL <<EOF
dn: cn=config
changetype: modify
replace: olcLogLevel
olcLogLevel: config stats acl
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment