This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yum install -y openldap-servers openldap-clients authconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mv /etc/openldap/slapd.d /etc/openldap/slapd.d.bckp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include /etc/openldap/schema/core.schema | |
include /etc/openldap/schema/cosine.schema | |
include /etc/openldap/schema/inetorgperson.schema | |
include /etc/openldap/schema/nis.schema | |
pidfile /var/run/openldap/slapd.pid | |
argsfile /var/run/openldap/slapd.args | |
database bdb | |
suffix "dc=example,dc=com" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ touch /var/lib/ldap/DB_CONFIG | |
$ service slapd start | |
$ chkconfig slapd on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ service ldap stop | |
$ chown -R ldap /var/lib/ldap | |
$ rm -f /var/lib/ldap/alock | |
$ db_recover | |
$ service ldap start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat > base.ldif <<EOM | |
dn: dc=example,dc=com | |
dc: example | |
objectClass: top | |
objectClass: domain | |
dn: ou=People,dc=example,dc=com | |
ou: People | |
objectClass: top | |
objectClass: organizationalUnit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat > group.ldif <<EOM | |
dn: cn=john,ou=Group,dc=example,dc=com | |
cn: john | |
userPassword: {crypt}x | |
gidNumber: 2001 | |
objectClass: posixGroup | |
objectClass: top | |
EOM | |
$ ldapmodify -a -h localhost \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat > john.txt <<EOM | |
dn: uid=john,ou=People,dc=example,dc=com | |
userPassword: johnpass | |
cn: john | |
uid: john | |
givenName: John The User | |
sn: 1 | |
shadowLastChange: 12345 | |
shadowMax: 99999 | |
shadowWarning: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ldapsearch -h localhost \ | |
-D "cn=Manager,dc=example,dc=com" \ | |
-w secret \ | |
-s sub | |
"objectclass=*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ authconfig --enableldap \ | |
--enableldapauth \ | |
--ldapserver=127.0.0.1 \ | |
--ldapbasedn="dc=example,dc=com" \ | |
--disableldaptls \ | |
--update |
OlderNewer