Adding user and assigning password for user in LDAP

Sample  file

cat user.ildf

dn: cn=server1user1,ou=group,dc=ldap,dc=devserver,dc=local
cn: server1user1
objectClass: top
objectClass: posixGroup
gidNumber: 10000

# User account
dn: uid=server1user1,ou=people,dc=ldap,dc=devserver,dc=local
cn: Server1 user1
givenName: Suesr1
sn: user1
uid: server1user1
uidNumber: 120000
gidNumber: 120000
homeDirectory: /home/server1user1
mail: server1user1@dev.local
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
loginShell: /bin/bash
userPassword: {CRYPT}*


Adding User command 

ldapadd -c -x -D cn=admin,dc=ldap,dc=devserver,dc=local -W -f /tmp/addUser.ldif  

Adding password for that user command

ldappasswd -x -D cn=admin,dc=ldap,dc=devserver,dc=local -W -S uid=server1test3,ou=people,dc=ldap,dc=devserver,dc=local


, ,

Comments are closed.