ID #1156

How can I migrate system users to LDAP?

How can I migrate users and groups from /etc/passwd and /etc/group to Bright's LDAP?


The following steps should be done on the head node.


1. Install the required packages:


# yum install migrationtools.noarch


2. Edit configuration file and modify it as follows:


# cd /usr/share/migrationtools/

# vim

a. Point to Bright LDAP:


$DEFAULT_BASE = "dc=cm,dc=cluster";



b. Comment out “ou=People” and “top” object class, so that they are excluded from the files that will be generated:


#       $NAMINGCONTEXT{'passwd'}            = "ou=People";


#       print $HANDLE "objectClass: top\n";



c. Add support to inetOrgPerson instead of account object class:





3. Edit script and comment out the following lines to prevent creating the relevant object classes:

# cd /usr/share/migrationtools/

# vim


#       print $HANDLE "objectClass: person\n";

#       print $HANDLE "objectClass: organizationalPerson\n";


#       print $HANDLE "objectClass: top\n";


4. Export the local /etc/passwd and /etc/group

# cd /usr/share/migrationtools/

# ./ /etc/group ~/group.ldif

# ./ /etc/passwd ~/passwd.ldif


5. Import the exported files into Bright LDAP:

# ldapadd -x -W -D "cn=root,dc=cm,dc=cluster" -f ~/group.ldif

# ldapadd -x -W -D "cn=root,dc=cm,dc=cluster" -f ~/passwd.ldif





  • Consider editing the generated passwd.ldif and group.ldif files and remove the users and groups that you don't want to add to Bright LDAP. For example we recommend that root is not managed by Bright LDAP.

  • If you're using a different shadow file, edit to point to that modified shadow file.

  • You can retrieve the LDAP password from /cm/local/apps/cmd/etc/cmd.conf to use it.



issue: Can’t start LDAP


# service ldap restart

Stopping slapd:                     [  OK  ]

id: ldap: No such user

find: invalid argument ´(' to ´-uid'

Checking configuration files for slapd:  /sbin/runuser: user ldap does not exist




LDAP user doesn’t exist in /etc/passwd, add it to /etc/passwd to be able to start LDAP.


issue: Can’t clear surname


[adel60-centos6-sge->user[abrt]]% clear surname

[adel60-centos6-sge->user*[abrt*]]% commit

Code  Field  Message

----- ------ ---------------------------------------------

1     LDAP   Error performing user ldap_add_ext_s: Invalid

             syntax. New dn:uid=abrt,dc=cm,dc=cluster  



surname can’t be empty; add a value to be able to commit changes.

Tags: -

Related entries:

You cannot comment on this entry