Skip to content

Instantly share code, notes, and snippets.

@kamituel
Last active December 11, 2015 02:09
Show Gist options
  • Save kamituel/4528843 to your computer and use it in GitHub Desktop.
Save kamituel/4528843 to your computer and use it in GitHub Desktop.
Add user to LDAP
$ cat > john.txt <<EOM
dn: uid=john,ou=People,dc=example,dc=com
userPassword: johnpass
cn: john
uid: john
givenName: John The User
sn: 1
shadowLastChange: 12345
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 2001
gidNumber: 2001
homeDirectory: /home/john
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
objectClass: topq
EOM
$ ldapmodify -a -h localhost \
-D "cn=Manager,dc=example,dc=com" \
-w secret \
-f john.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment