Skip to content

Any easy way to disable anonymous bind? #48

Answered by motey
motey asked this question in Q&A
Discussion options

You must be logged in to vote

This Script should help you to disable anonymous login
I am not an expert on LDAP ldif scripts; Please review before use.

Any suggestions for improvements are welcome ❤️

#!/bin/bash
# disable the anonymous bind/login enabled by default
# Based on https://serverfault.com/questions/325912/disallow-global-anonymous-bind-with-cn-config/476429#476429

# SETUP

CONTAINER_NAME_OPENLDAP=ldap

# Disable fronted anonymous login
docker exec ${CONTAINER_NAME_OPENLDAP} bash -c "cat <<EOT >>/tmp/disable_anon_frontend.ldif
dn: olcDatabase={-1}frontend,cn=config
add: olcRequires
olcRequires: authc
EOT"

docker exec ${CONTAINER_NAME_OPENLDAP} ldapmodify -Q -Y EXTERNAL -H 'ldapi:///' -f /tmp/disable_anon_f…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by motey
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant