cas登录后台验证账号来自ldap,需要批量导入账号到ldap,这个问题几经研究,最后方法如下:
先编写程序生成ldif格式文件,然后再在ldapadmin.exe程序或 phpldapadmin网页中导入这个ldif文件
1. 生成的ldif文件格式:
【空行】
dn: uid=20170109,ou=201701,ou=2017,ou=student,ou=people,dc=linbsoft,dc=com
cn:: 5ZGo56Kn5LqR
displayname:: 5ZGo56Kn5LqR
gidnumber: 0
givenname: 20170109
homedirectory: 20170109
mail: 20170109@linbsoft.com
objectclass: posixAccount
objectclass: top
objectclass: inetOrgPerson
sn: 20170109
uid: 20170109
uidnumber: 170109
userpassword: 8888
【空行】
dn: uid=20170108,ou=201701,ou=2017,ou=student,ou=people,dc=linbsoft,dc=com
cn:: 6ZmI54K8546J
displayname:: 6ZmI54K8546J
gidnumber: 0
givenname: 20170108
homedirectory: 20170108
mail: 20170108@linbsoft.com
objectclass: posixAccount
objectclass: top
objectclass: inetOrgPerson
sn: 20170108
uid: 20170108
uidnumber: 170108
userpassword: 1234
【空行】
2. 要注意空行和空格