0

I want to update passwords [user's already existing in ldap] of the user by importing data from /etc/passwd & /etc/shadow

How to achieve this ?

I will give the overview of my setup.

  • nodes user id & password managed by management node [xcat], ldap not used for this purpose.

We have imported the user's from management node to ldap server by following the below given steps:-

  1. Copied /etc/passwd, /etc/group & /etc/shadow from management node.
  2. getent passwd > /tmp/passwd.out getent shadow > /tmp/shadow.out
  3. cd /usr/share/migrationtools/ ./migrate_passwd.pl /tmp/passwd.out > /tmp/passwd.ldif
  4. ldapadd -x -W -D "cn=Manager,dc=aadityaldap,dc=com" -f /tmp/passwd.ldif

Now we want to update the passwords frequently and keep the ldap server sync with out management node. please give me idea how to achive this.

I tried the same way i imported users into ldap but it gives me an error.

[root@iitmserver2 migrationtools]# ldapmodify -x -W -D "cn=Manager,dc=aadityaldap,dc=com" -f /tmp/passwd.ldif
Enter LDAP Password: 
ldapmodify: modify operation type is missing at line 2, entry "uid=pharthiphan,ou=People,dc=aadityaldap,dc=com"
user207421
  • 305,947
  • 44
  • 307
  • 483
  • Your ldif seems to be incorrect, you may find a valid LDIF example here: http://stackoverflow.com/questions/11036747/modify-passwords-in-an-ldif-file-using-ldapmodify-command – Vilmantas Baranauskas Jul 02 '15 at 14:19
  • You have an LDIF syntax error, but this won't work anyway. The passwords aren't *in* /etc/passwd. Only a hash of them. – user207421 Jul 02 '15 at 23:28

0 Answers0