Configure success with this article
Http://blog.sina.com.cn/s/blog_64aac6750101gwst.html
/etc/sysconfig/network# hostname/etc/hosts#172.16.16.22 ldap.zxsoft.com# Host name setenforce 0chkconfig iptables offservice iptables stop#/etc/sysconfig/iptables-a input -p tcp -- dport 389 -j acceptyum install -y openldap-clients openldap-serversslappasswdvim /etc/openldap/slapd.conf# production domain Administrator password #rootpw {SSHA}f70mll7gNuDidYwh1gcYDdvZQb7l64Llsuffix "dc=zxsoft,dc=com" rootdn "CN=MANAGER,DC =zxsoft,dc=com "#测试slapd. conf file under Slaptest -u -f slapd.conf#/var/lib/ldap directory cp /usr/share/ openldap-servers/db_config.example /var/lib/ldap/db_configchown ldap.ldap db_config* #添加 * After the anti-warning chkconfig slapd on/etc/init.d/slapd startldapsearch -x -b "dc=zxsoft,dc=com "#创建待认证的用户. Finally, specify a specific home directory. such as:/netdir/guestsmkdir -p /ldapdir/users# Create user useradd -u 1811 -d /ldapdir/users/ldapuser11 ldapuser11echo "password" | passwd --stdin ldapuser11# load Migration Tool Migrationtools, Used to migrate system users to LDAP users. Yum -y install migrationtoolsvim /usr/share/migrationtools/migrate_common.ph$default_mail_ domain = "zxsoft.com"; $DEFAULT _base = "dc=zxsoft,dc=com";. The/migrate_base.pl >base.ldif# file Base.ldif only retains the following three parts dc: zxsoftobjectclass: topobjectclass: domaindn: ou=people,dc=zxsoft,dc=comou: peopleobjectclass: topobjectclass: organizationalunitdn: ou=group,dc=zxsoft,dc=comou: groupobjectclass: topobjectclass: organizationalunit# Create a user database file: It is best to first migrate to LDAP user as a standalone file grep ldapuser /etc/passwd >user.txt./ migrate_passwd.pl user.txt ./user.ldif# detects the following ldapsearch -x -b -l "dc=zxsoft,dc=com "Grep ldapuser /etc/group >group.txt./migrate_passwd.pl group.txt groups.ldif# to be tested # ./migrate_base.pl > /tmp/base.ldif# ./migrate_ passwd.pl /etc/passwd > /tmp/passwd.ldif# ./migrate_group.pl /etc/ group > /tmp/group.ldif# Restart SLADP, migrate user/etc/init.d/slapd restartldapadd -d "cn= Manager,dc=zxsoft.dc=com " -w -x -f /usr/share/migrationtools/base.ldifldapadd -x -D "Cn=manager,dc=zxsoft,dc=com" -w -f /usr/share/migrationtools/user.ldifldapadd -x -D "Cn=manager,dc=zxsoft,dc=com" -w -f /usr/share/migrationtools/groups.ldif #提示gidnumber处语法错误??? After adding 1811 1812 1813, the hint already exists and it seems to have succeeded #client authentication end configuration Yum install fprintd-pam#yum install -y nss-pam-ldapd ypbind pam_ldap#client authentication module, the first test when prompted missing files, after installation to resolve vi /etc/openldap/ldap.conf# Add base uri# #TLS_CACERTDIR /etc/openldap/cacertsbase dc=zxsoft,dc=comuri ldap:// 172.16.16.22touch -r /ldapdir/usersmount -t nfs 172.16.16.22:/ldapdir/users /ldapdir/users# This service restarts after the configuration is complete/etc/ init.d/nslcd restart #认证测试成功
Using the LDAP Amdin connection is successful, it is found that the software is not used, the current practice is to create a new user in the system, copy the password Sha value from the/etc/passwd, and then use Ldapadmin to export a user, After modifying the contents of the. ldif file, add the password Sha value, then import it into ldapadmin, and find that the new user can use it properly. sudo permissions have not been made clear yet.
This article is from the "Potato It" blog, be sure to keep this source http://malin314.blog.51cto.com/7206614/1864994
OpenLDAP Service-side installation