Discussion:
How can I add ldap user from linux shell command line?
Tian Zhiying
2014-08-26 06:34:54 UTC
Permalink
Hi All

How can I add ldap user from linux shell command line?
And how can I batch add ldap user from linux shell command line?




Tian Zhiying
Ulrich Windl
2014-08-26 07:14:07 UTC
Permalink
slapcat your users to get a reference user. Then convert the reference user to the new user to add. use ldapadd to add the new user via LDIF.
Man useradd also suggests it can do it via LDAP:

SYNOPSIS
useradd [-D binddn] [-P path] [-c comment] [-d homedir]
[-e expire] [-f inactive] [-G group,...] [-g gid]
[-m [-k skeldir]] [-o] [-p password] [-u uid]
[-U umask] [-r] [-s shell] [--service service] [--help]
[--usage] [-v] [--preferred-uid uid] account


Regards,
Ulrich
Post by Tian Zhiying
Hi All
How can I add ldap user from linux shell command line?
And how can I batch add ldap user from linux shell command line?
Tian Zhiying
Scott Classen
2014-08-26 16:38:18 UTC
Permalink
Post by Tian Zhiying
Hi All
How can I add ldap user from linux shell command line?
And how can I batch add ldap user from linux shell command line?
Tian Zhiying
slapadd?
Post by Tian Zhiying
Slapadd is used to add entries specified in LDAP Directory Interchange Format (LDIF) to a slapd(8) database. It opens the given database determined by the database number or suffix and adds entries corresponding to the provided LDIF to the database. The LDIF input is read from standard input or the specified file.
So make an LDIF file for your new user and inject with slapadd.

Scott

Loading...