添加用户

 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"


你可能感兴趣的:(replace,配置文件,password)