linux用户,组迁移ldap服务中

1.利用pl脚本将/etc/passwd 和/etc/group生成LDAP能读懂的文件格式

yum install -y migrationtools

获取用户信息追加到一个文件中:cat /etc/passwd > people

获取组信息追加到一个文件中:cat /etc/group > group

根据people生成ldap用户数据文件people.ldif     /usr/share/migrationtools/migrate_passwd.pl people people.ldif 

根据group生成ldap组的数据文件 group.ldif      /usr/share/migrationtools/migrate_group.pl group group.ldif

导入用户:ldapadd -x -D "cn=Manager,dc=joydata,dc=com" -W -f people.ldif

导入组:ldapadd -x -D "cn=Manager,dc=joydata,dc=com" -W -f group.ldif

ldapsearch查看用户的数据:

ldapsearch -x -W -D "uid=zhangyuntao,ou=People,dc=joydata,dc=com" 

输入ldap的密码就能看到该用户的信息了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容