OpenDJ
OpenDJ
Installation
- Start by downloading the latest version of the opendj-4.x.x_all.debfile from the website https://github.com/OpenIdentityPlatform/OpenDJ/releases :
- Start the installation:
Initial configuration
To simplify the OpenDJ configuration process, we will create a “setupOpenDJ.props” file containing the available options to be passed to OpenDJ’s “setup” utility (this allows you to bypass the configuration interface).
The file is to be created in the directory /opt/opendj with the following contents :
# Sample properties file to set up OpenDJ directory server
# See OpenDJ Setup command man for more options
#
# Root user Distinguished Name (DN) identifies a user who can perform all operations allowed for the server
rootUserDN =cn=Directory Manager
# Password for root user LDAP
rootUserPassword =adminOpenDJ1
# OpenDJ uses fully qualified host name in self-signed certificates and for identification when you use replication
hostname =localhost.localdomain
# Port used for connection with LDAP
ldapPort =389
# This is the service port used to configure the server and to run tasks
adminConnectorPort =4444
# Identifies the implementation of the repository that holds your data
backendType =je
# Directory Name for your LDAP
baseDN =dc=digdash,dc=com
addBaseEntry =true
# Secure LDAP Port used for SSL connection
ldapsPort =636
# Use StartTLS to negotiate a secure connection between a client and server
enableStartTLS =false
# Self-signed certificates for externally facing ports facilitate testing, but are not intended for production use
generateSelfSignedCertificate =true
# Start at the end of setup
start =true
After saving the file, run the following command line:
Additional configuration
- Navigate to the OpenDJ installation directory:
The LDIF files can be downloaded by clicking on the following link .
- Create the organisations using the “neworganisation.ldif” file below:
objectClass: organizationalUnit
ou: default
- Set the “Custom Character-set Password Validator”:
- Apply the password validator:
- Configure the password policy for users using the “ppolicy.ldif” file below:
objectClass: top
objectClass: subentry
objectClass: pwdPolicy
cn: ppolicy
pwdAttribute: userPassword
pwdAllowUserChange: TRUE
pwdCheckQuality: 1
pwdExpireWarning: 600
pwdFailureCountInterval: 30
pwdGraceAuthNLimit: 5
pwdInHistory: 5
pwdLockout: TRUE
pwdLockoutDuration: 900
pwdMaxAge: 0
pwdMaxFailure: 5
pwdMinAge: 0
pwdMustChange: FALSE
pwdSafeModify: FALSE
subtreeSpecification: {base "ou=users", specificationFilter "!(uid=admin)" }
- Configure a second password policy for the admin using the “ppolicy-admin.ldif” file below:
objectClass: top
objectClass: subentry
objectClass: pwdPolicy
cn: ppolicy-admin
pwdAttribute: userPassword
pwdAllowUserChange: TRUE
pwdCheckQuality: 1
pwdFailureCountInterval: 30
pwdGraceAuthNLimit: 5
pwdInHistory: 5
pwdLockout: FALSE
pwdMaxAge: 0
pwdMinAge: 0
pwdMustChange: FALSE
pwdSafeModify: FALSE
subtreeSpecification: {base "ou=users", specificationFilter "(uid=admin)" }
- Modify the password policy to allow pre-encoded passwords (useful for restores in Digdash):
- Create an admin user for Digdash using the “create_user_admin.ldif” file below:
objectClass: shadowAccount
objectClass: inetOrgPerson
cn: Admin Domain Default
sn: Default
uid: admin_default
- Assign the necessary rights to this user using the “add_admin_right.ldif” and “add_admin_right2.ldif” files below:
changetype: modify
add: aci
aci: (target ="ldap:///ou=default,dc=digdash,dc=com")(targetattr = "userpassword || shadowlastchange")(version 3.0; acl "allow write on userpassword and shadowlastchange for admin"; allow(write) (userdn = "ldap:///uid=admin,ou=default,dc=digdash,dc=com");)
aci: (target ="ldap:///ou=default,dc=digdash,dc=com")(targetattr = "userpassword || shadowlastchange")(version 3.0; acl "allow read,write on userpassword and shadowlastchange for auth users"; allow(read) (userdn = "ldap:///all");)
aci: (target ="ldap:///ou=default,dc=digdash,dc=com")(targetattr = "userpassword || shadowlastchange")(version 3.0; acl "allow read on userpassword and shadowlastchange for anonymous"; allow(selfwrite) (userdn = "ldap:///anyone");)
aci: (target ="ldap:///ou=default,dc=digdash,dc=com")(targetattr = "*")(version 3.0; acl "allow write on * for admin"; allow(all) (userdn = "ldap:///uid=admin,ou=default,dc=digdash,dc=com");)
aci: (target ="ldap:///ou=default,dc=digdash,dc=com")(targetattr = "*")(version 3.0; acl "allow read on * for anonymous"; allow(read) (userdn = "ldap:///all");)
changetype: modify
add: ds-privilege-name
ds-privilege-name: config-read
ds-privilege-name: password-reset
ds-privilege-name: unindexed-search
- Generate a password for the administrator and make a note of it for later:
Enabling the service to start automatically at boot
- Create the opendj.service file:
- And paste the following lines into it:
Description=OpenDJ Server Daemon
Wants=network-online.target
After=network-online.target
Conflicts=shutdown.target
[Service]
Type=simple
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/opt/opendj/bin/start-ds --quiet
ExecStop=/opt/opendj/bin/stop-ds --quiet
[Install]
WantedBy=multi-user.target
- Then enter the following commands:
systemctl daemon-reload
systemctl enable --now opendj
systemctl status opendj
Useful function
The operation below is not part of the installation.
However, it may be useful to be aware of it for future reference.
Extending the limit for LDAP searches
To increase the limit on the number of results returned during a search to more than 1,000 users, edit the “extend_search_limit.ldif” file below:
changetype: modify
add: ds-rlim-size-limit
ds-rlim-size-limit: 10000
To increase the number of entries scanned during a search, add the “ds-rlim-lookthrough-limit.ldif” file:
changetype: modify
replace: ds-rlim-lookthrough-limit
ds-rlim-lookthrough-limit: 100000
Then run:
