1.利用pl腳本將/etc/passwd?和/etc/group生成LDAP能讀懂的文件格式
yum install -y migrationtools
獲取用戶信息追加到一個(gè)文件中:cat?/etc/passwd?>?people
獲取組信息追加到一個(gè)文件中:cat?/etc/group?>?group
根據(jù)people生成ldap用戶數(shù)據(jù)文件people.ldif? ? ?/usr/share/migrationtools/migrate_passwd.pl?people?people.ldif?
根據(jù)group生成ldap組的數(shù)據(jù)文件 group.ldif? ? ? /usr/share/migrationtools/migrate_group.pl?group?group.ldif
導(dǎo)入用戶:ldapadd -x -D "cn=Manager,dc=joydata,dc=com" -W -f people.ldif
導(dǎo)入組:ldapadd -x -D "cn=Manager,dc=joydata,dc=com" -W -f group.ldif
ldapsearch查看用戶的數(shù)據(jù):
ldapsearch -x -W -D "uid=zhangyuntao,ou=People,dc=joydata,dc=com"?
輸入ldap的密碼就能看到該用戶的信息了枢冤。