Operating System - Linux
1752725 Members
5813 Online
108789 Solutions
New Discussion юеВ

ldapadd command doesn't work in RHEL v3u4

 
Gary L
Super Advisor

ldapadd command doesn't work in RHEL v3u4

Hi

I have a LDAP server and a client, they are all RHEL v3u4. Currently I met a problem, sometimes ldapadd command doesn't work, could not create user account in LDAP database, details are as follow.

1. create *.ldif files
======================
I created two ldap files u2222.ldif and u8888.ldif through the same template and did a little bit modifications.

# cat u2222.ldif
dn: uid=u2222,ou=People,dc=hh,dc=ca
uid: u2222
cn: u2222
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}OYKa4hfoki5k6
shadowLastChange: 12922
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/ksh
uidNumber: 2222
gidNumber: 100
homeDirectory: /home/u2222

# cat u8888.ldif
dn: uid=u8888,ou=People,dc=hh,dc=ca
uid: u8888
cn: u8888
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}OYKa4hfoki5k6
shadowLastChange: 12922
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/ksh
uidNumber: 8888
gidNumber: 100
homeDirectory: /home/u8888


2. run command ldapadd
======================
# ldapadd -x -D "cn=manager,dc=hh,dc=ca" -w abcde -f u2222.ldif

# ldapadd -x -D "cn=manager,dc=hh,dc=ca" -w abcde -f u8888.ldif

(abcde is the correct passwd)

Above commands worked without error.


3. Verification
===============
# id u8888
uid=8888(u8888) gid=100(users) groups=100(users)

# id u2222
id: j4222: No such user

u2222 once be used before, that user wanna reset passwd for him. I tried but didn't work. I removed this user account via cmd # ldapdelete -x -D "cn=manager,dc=hh,dc=ca" -w abcde "uid=2222,ou=People,dc=hh,dc=ca", worked. And I wannt recreate it via cmd ldapadd. But met above problem. new user could not be checked out in the LDAP server. u8888 is the new user account haven't been used before. It could be created and check out in the system, and ldapdelete worked for u8888.

BTW, all the changes have been done in the LDAP server.

I think, u2222's some old ldap records should be hided some where in the system, otherwise why u8888 worked and u2222 didn't work.

Could you please tell me how to fix it. Any answers will be very appreciate.

-G
4 REPLIES 4
Gary L
Super Advisor

Re: ldapadd command doesn't work in RHEL v3u4

Sorry, the item-3 verification # id u2222 output shoulbe be

id: u2222: No such user

Gary L
Super Advisor

Re: ldapadd command doesn't work in RHEL v3u4

BTW, run cmd ldapsearch, u8888 has correct output, but u2222 no output. User u2222 does not exist in the LDAP database.
Gary L
Super Advisor

Re: ldapadd command doesn't work in RHEL v3u4

I run the ldapadd cmd again for u2222, I got below message:
...
ldap_add: Already exists

ldif_record() = 68

but id u2222 no that user

??
Gary L
Super Advisor

Re: ldapadd command doesn't work in RHEL v3u4

Additional input:

ldapdelete worked for user "u2222".

Although # id u2222 didn't work. But ldapadd command output user existing. And I could run command ldapdelete to remove user u2222 and re-create it later. But why command id could not show user u2222.

Thanks.

-G