添加用戶

 1.設置用戶密碼

   #slappasswd

   New password:

   Re-enter new password:

  {SSHA}xxxxxxxxxxxxxxxxx

2.編寫配置文件

  vi ldapuser.ldif

# create new

# replace to your own domain name for "dc=***,dc=***" section

dn: uid=qa,ou=People,dc=server,dc=world

objectClass: inetOrgPerson

objectClass: posixAccount

objectClass: shadowAccount

cn: qa

sn: Linux

userPassword: {SSHA}xxxxxxxxxxxxxxxxx

loginShell: /bin/bash

uidNumber: 1000

gidNumber: 1000

homeDirectory: /home/qa


dn: cn=qa,ou=Group,dc=qiqiu,dc=com

objectClass: posixGroup

cn: qa

gidNumber: 1000

memberUid: qa

3.添加用戶

ldapadd -x -D cn=admin,dc=qiqiu,dc=com -W -f ldapuser.ldif

Enter LDAP Password:

adding new entry "uid=qa,ou=People,dc=qiqiu,dc=com"


adding new entry "cn=qa,ou=Group,dc=qiqiu,dc=com"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章