Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


ldap:create_user

~~TOC~~

OpenLDAP - create user

  • Create user LDIF:
    # vim newuser.ldif
    dn: uid=newuser,ou=people,dc=<domain>,dc=<TLD>
    objectClass: top
    objectClass: account
    objectClass: posixAccount
    objectClass: shadowAccount
    cn: newuser
    uid: newuser
    uidNumber: 1234
    gidNumber: 1234
    homeDirectory: /home/newuser
    loginShell: /bin/bash
    gecos: newuser surname
    userPassword: {crypt}x
    shadowLastChange: 0
    shadowMax: 0
    shadowWarning: 0
  • Add LDIF to LDAP:
    ldapadd -H ldaps://<FQDN> -x -W -D "<Manager DN>" -f newuser.ldif
  • Set password:
    ldappasswd -H ldaps://<FQDN> -S -x -W -D "<Manager DN>" "uid=newuser,ou=People,dc=<domain>,dc=<tld>"
ldap/create_user.txt · Last modified: 2015/09/07 15:58 by admin