OpenLDAP: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
< | <syntaxhighlight lang="bash"> | ||
apt update | apt update | ||
apt list --upgradable | apt list --upgradable | ||
apt install slapd ldap-utils | apt install slapd ldap-utils | ||
</ | </syntaxhighlight> | ||
==Configure== | ==Configure== | ||
< | <syntaxhighlight lang="bash"> | ||
ldapwhoami -H ldap:// -x | ldapwhoami -H ldap:// -x | ||
dpkg-reconfigure slapd | dpkg-reconfigure slapd | ||
ls -lah /var/backups/ | ls -lah /var/backups/ | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="bash" highlight="9,10" line> | ||
cat > /etc/ldap/ldap.conf <<'EOF' | cat > /etc/ldap/ldap.conf <<'EOF' | ||
# | # | ||
Line 31: | Line 31: | ||
TLS_CACERT /etc/ssl/certs/ca-certificates.crt | TLS_CACERT /etc/ssl/certs/ca-certificates.crt | ||
EOF | EOF | ||
</ | </syntaxhighlight> | ||
==phpLDAPadmin== | ==phpLDAPadmin== | ||
< | <syntaxhighlight lang="bash"> | ||
#apt install phpldapadmin | #apt install phpldapadmin | ||
#a2enmod proxy_fcgi setenvif | #a2enmod proxy_fcgi setenvif | ||
Line 43: | Line 43: | ||
cp /var/www/html/phpLDAPadmin/config/config.php.example \ | cp /var/www/html/phpLDAPadmin/config/config.php.example \ | ||
/var/www/html/phpLDAPadmin/config/config.php | /var/www/html/phpLDAPadmin/config/config.php | ||
</ | </syntaxhighlight> | ||
< | <syntaxhighlight lang="bash"> | ||
# phpldapadmin config update for localhost | # phpldapadmin config update for localhost | ||
# PHPC_FILE='/etc/phpldapadmin/config.php' | # PHPC_FILE='/etc/phpldapadmin/config.php' | ||
Line 74: | Line 74: | ||
LDAP_WARN_FILL="$config->custom->appearance['hide_template_warning'] = true;" | LDAP_WARN_FILL="$config->custom->appearance['hide_template_warning'] = true;" | ||
sed -i "s@$LDAP_WARN_FIND.*@$LDAP_WARN_FILL@" "$PHPC_FILE" | sed -i "s@$LDAP_WARN_FIND.*@$LDAP_WARN_FILL@" "$PHPC_FILE" | ||
</ | </syntaxhighlight> | ||
==References== | ==References== |
Revision as of 22:38, 3 April 2024
apt update
apt list --upgradable
apt install slapd ldap-utils
Configure
ldapwhoami -H ldap:// -x
dpkg-reconfigure slapd
ls -lah /var/backups/
cat > /etc/ldap/ldap.conf <<'EOF'
#
# LDAP Defaults
#
# See ldap.conf(5) for details
# This file should be world readable but not world writable.
BASE dc=chorke,dc=org
URI ldap://localhost ldap://localhost:666
#SIZELIMIT 12
#TIMELIMIT 15
#DEREF never
# TLS certificates (needed for GnuTLS)
TLS_CACERT /etc/ssl/certs/ca-certificates.crt
EOF
phpLDAPadmin
#apt install phpldapadmin
#a2enmod proxy_fcgi setenvif
#a2enconf php7.3-fpm
cd /var/www/html/
git clone https://github.com/breisig/phpLDAPadmin.git
cp /var/www/html/phpLDAPadmin/config/config.php.example \
/var/www/html/phpLDAPadmin/config/config.php
# phpldapadmin config update for localhost
# PHPC_FILE='/etc/phpldapadmin/config.php'
PHPC_FILE='/var/www/html/phpLDAPadmin/config/config.php'
# ldap server name change (line 286)
LDAP_NAME_FIND="$servers->setValue('server','name','My LDAP Server');"
LDAP_NAME_FILL="$servers->setValue('server','name','CK LDAP Server');"
sed -i "s@$LDAP_NAME_FIND.*@$LDAP_NAME_FILL@" "$PHPC_FILE"
# ldap server host change (line 293)
LDAP_HOST_FIND="$servers->setValue('server','host','127.0.0.1');"
LDAP_HOST_FILL="$servers->setValue('server','host','127.0.0.1');"
sed -i "s@$LDAP_HOST_FIND.*@$LDAP_HOST_FILL@" "$PHPC_FILE"
# ldap server base change (line 300)
LDAP_BASE_FIND="$servers->setValue('server','base',array('dc=example,dc=com'));"
LDAP_BASE_FILL="$servers->setValue('server','base',array('dc=chorke,dc=org'));"
sed -i "s@$LDAP_BASE_FIND.*@$LDAP_BASE_FILL@" "$PHPC_FILE"
# ldap server base change (line 326)
LDAP_BASE_FIND="$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com');"
LDAP_BASE_FILL="$servers->setValue('login','bind_id','cn=admin,dc=chorke,dc=org');"
sed -i "s@$LDAP_BASE_FIND.*@$LDAP_BASE_FILL@" "$PHPC_FILE"
# ldap server warn change (line 161)
LDAP_WARN_FIND="$config->custom->appearance['hide_template_warning'] = false;"
LDAP_WARN_FILL="$config->custom->appearance['hide_template_warning'] = true;"
sed -i "s@$LDAP_WARN_FIND.*@$LDAP_WARN_FILL@" "$PHPC_FILE"
References
- Install and Configure OpenLDAP and phpLDAPadmin on Ubuntu 16.04
- Install an OpenLDAP Server in Ubuntu 20.04 with phpLDAPadmin
- Install OpenLDAP and phpLDAPadmin on Ubuntu 20.04 LTS
- Manage and Use LDAP Servers with OpenLDAP Utilities
- Build LDAP Docker Image from Ubuntu
- Fazer downgrade pho 7.3 para 7.0
- OpenLDAP Administrator's Guide
- Clone phpLDAPadmin