Generate Password Online

Create password for .htaccess, .htpasswd or ldap etc.

Raw Content: (Copy)
Encoded Content: (Copy)
LDIF Content: (Copy)

ldap LDIF file example

Simple:

dn: cn=johndoe,ou=people,dc=example,dc=com
#dn: uid=johndoe,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
cn: johndoe
sn: Doe/Unknown
userPassword: {CRYPT}$1$abc$QH8J/F/2DQ6p7R5tym4Iw/

Full example:

dn: uid=johndoe,ou=people,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: John Doe
sn: Doe
uid: johndoe
uidNumber: 10001
gidNumber: 10001
homeDirectory: /home/johndoe
loginShell: /bin/bash

Explain:

In the context of LDAP (Lightweight Directory Access Protocol), cn=admin,dc=example,dc=com is a distinguished name (DN) that represents the entry of an administrator in the LDAP directory tree. Let’s break down the components:

cn=admin: This part specifies the common name (cn) attribute of the entry, which in this case is admin. The common name is typically used to represent the human-readable name of an entry, such as a user or administrator. dc=example,dc=com: This part specifies the base distinguished name (DN) of the LDAP directory tree. It consists of domain components (dc) separated by commas. In this example, example.com is a fictional domain, and dc=example,dc=com represents the root of the LDAP directory tree for the example.com domain. Putting it all together, cn=admin,dc=example,dc=com represents the administrator entry located within the LDAP directory tree rooted at dc=example,dc=com. This administrator entry typically has privileges to perform administrative tasks such as adding, modifying, and deleting entries in the LDAP directory.

In practice, the administrator entry may have additional attributes and values, such as a password, organizational information, or other administrative metadata, depending on the specific LDAP directory schema and configuration.

ldapadd -x -D "cn=admin,dc=example,dc=com" -W -f user.ldif
ldapsearch -x -b "dc=example,dc=com" "(uid=johndoe)"

Back to top

Discord, QQ group:418474680