CAS统一登录认证(13): ldap 批量导入用户

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. 要注意空行和空格

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值