[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1120
  • Last Modified:

Cant setup LDAP pls help!!!!!!!!!

Hi,

i want to test out  LDAP server iam following this article

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch31_:_Centralized_Logins_Using_LDAP_and_RADIUS

i did exactly as described but when i tried to run /usr/share/openldap/migration/migrate_all_offline.sh

My server is RHEL5 its also is an domain named Example.com
it throws me HUGE error pls see the attached snippet Sorry for very long error.

Thanks
[root@domain15 log]# /usr/share/openldap/migration/migrate_all_offline.sh
Creating naming context entries...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_base.pl line 39.
Migrating groups...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_group.pl line 39.
Migrating hosts...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_hosts.pl line 39.
Migrating networks...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_networks.pl line 39.
Migrating users...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_passwd.pl line 40.
Migrating protocols...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_protocols.pl line 39.
Migrating rpcs...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_rpc.pl line 39.
Migrating services...
Unquoted string "example" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 1.
Unquoted string "com" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 1.
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
Unquoted string "dc" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 4.
Unquoted string "example" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 4.
Unquoted string "dc" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 4.
Unquoted string "com" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 4.
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Possible unintended interpolation of @Kristof in string at /usr/share/openldap/migration/migrate_common.ph line 4.
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
Unquoted string "ldap" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 10.
Unquoted string "example" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 10.
Unquoted string "com" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 10.
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
Unquoted string "mail" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 16.
Unquoted string "example" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 16.
Unquoted string "com" may clash with future reserved word at /usr/share/openldap/migration/migrate_common.ph line 16.
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_services.pl line 40.
Migrating netgroups...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_netgroup.pl line 39.
Importing into LDAP...
Migrating netgroups (by user)...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_netgroup_byuser.pl line 39.
Migrating netgroups (by host)...
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
  (Might be a runaway multi-line "" string starting on line 1)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = "dc"
        (Missing operator before dc?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h ""
  (Might be a runaway multi-line "" string starting on line 4)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 10, near "#define(`confLDAP_DEFAULT_SPEC',`-h "ldap"
        (Missing operator before ldap?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = ""
  (Might be a runaway multi-line "" string starting on line 10)
        (Missing semicolon on previous line?)
Bareword found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 16, near "# $DEFAULT_MAIL_HOST = "mail"
        (Missing operator before mail?)
String found where operator expected at /usr/share/openldap/migration/migrate_common.ph line 58, near "if (-x ""
  (Might be a runaway multi-line "" string starting on line 16)
        (Missing semicolon on previous line?)
syntax error at /usr/share/openldap/migration/migrate_common.ph line 4, near "$DEFAULT_BASE = ""
Compilation failed in require at /usr/share/openldap/migration/migrate_netgroup_byhost.pl line 39.
Preparing LDAP database...
[root@domain15 log]#

Open in new window

0
ee024
Asked:
ee024
  • 10
  • 10
1 Solution
 
martin_2110Commented:
Perhaps your missing a ; on some lines. I would recommend checking each line and making sure you did not delete a semicolon. If that does not work I would grab a fresh copy of migrate_common.ph
0
 
ee024Author Commented:
but from where i can grab fresh copy?
0
 
martin_2110Commented:
If it was me i would reinstall the rpm if its an rpm. You might check the lines you edited in the script and make sure they end with a ; My guess is you replaced a default value with your value and neglected  to replace the ; at the end.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
ee024Author Commented:
i just replaced padl to example see  just changes

example.com";

# Default base
$DEFAULT_BASE = "dc=example,dc=com";

# Turn this on for inetLocalMailReceipient
# sendmail support; add the following to
# sendmail.mc (thanks to Petr@Kristof.CZ):
##### CUT HERE #####
#define(`confLDAP_DEFAULT_SPEC',`-h "ldap.example.com"')dnl
#LDAPROUTE_DOMAIN_FILE(`/etc/mail/ldapdomains')dnl
#FEATURE(ldap_routing)dnl
##### CUT HERE #####
# where /etc/mail/ldapdomains contains names of ldap_routed
# domains (similiar to MASQUERADE_DOMAIN_FILE).
# $DEFAULT_MAIL_HOST = "mail.example.com";

# turn this on to support more general object clases
# such as person.
$EXTENDED_SCHEMA = 0;


0
 
ee024Author Commented:
i meant just 4 changes
0
 
martin_2110Commented:
I attached mine with some renaming to example.com
0
 
martin_2110Commented:
1 more time.
migrate-common.ph.txt
0
 
ee024Author Commented:
Thanks but needed migrate_all_offline.sh
0
 
martin_2110Commented:
I dont think you need it, it is a perl script  your errors look like perl. Here ya go.
migrate-all-offline.sh.txt
0
 
martin_2110Commented:
What I meant to say...
I dont think you need it, it is a shell script  your errors look like perl. Here ya go
0
 
ee024Author Commented:
after reinstalling all packages it gives me new error
=> bdb_tool_entry_put: id2entry_add failed: DB_KEYEXIST: Key/data pair already exists (-30996)
=> bdb_tool_entry_put: txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)
slapadd: could not add entry dn="cn=echo,ou=Services,dc=example,dc=com" (line=2917): txn_aborted! DB_KEYEXIST: Key/data pair already exists (-30996)
Migration failed: saving failed LDIF to /tmp/nis.ldif.GA3258


pls help me out

Thanks
0
 
ee024Author Commented:
Now somehow its working even after above error i have setup autofs on client so that it can automatically get his/her home dir  automatically but even after mounting all home dir of LDAP server only ldapuser can login which was created during ldap setup.
I  have used updatedb command restarted ldap and run migrate_all_offline.ph again but still only this user can login i wonder y only this user getting login?
0
 
martin_2110Commented:
Are the users in the database, what happens when you run slapcat on the server.
What are the perminsions on ldap database, ldap user should be able write to all all the files in /var/lib/ldap
When you run getent passwd on the client do you see users you created?

0
 
ee024Author Commented:
output of slapcat is attached i dont know what it really means and permission are as follows
[root@domain15 ~]# ls -al /var/lib/ldap/
total 772
drwx------  3 ldap ldap     4096 Nov  6 13:27 .
drwxr-xr-x 29 root root     4096 Apr 10 21:59 ..
-rw-r--r--  1 ldap ldap     2048 Apr 10 22:13 alock
-rw-------  1 ldap ldap    24576 Apr 10 22:13 __db.001
-rw-------  1 ldap ldap   278528 Apr 10 22:13 __db.002
-rw-------  1 ldap ldap   270336 Apr 10 22:13 __db.003
-rw-------  1 ldap ldap    98304 Apr 10 22:13 __db.004
-rw-------  1 ldap ldap   352256 Apr 10 22:13 __db.005
-rw-------  1 ldap ldap    24576 Apr 10 22:13 __db.006
-rw-------  1 ldap ldap     8192 Apr 10 22:13 dn2id.bdb
drwxr-xr-x  2 ldap ldap     4096 Apr 11 13:36 example.com
-rw-------  1 ldap ldap    32768 Apr 10 22:13 id2entry.bdb
-rw-------  1 ldap ldap 10485760 Apr 10 22:13 log.0000000001
-rw-r--r--  1 ldap ldap      212 Apr 11 13:36 openldap-severs-update.log
[root@domain15 ~]#


when i run getent passwd command on  client i can see ldapuser there and other local users on client systems not others from server.


Thanks for being with me
0
 
martin_2110Commented:
try this on the server it will backup then empty the ldap database
shutdown ldap
cp -rvp /var/lib/ldap /var/lib/ldap.backup
rm -rf /var/lib/ldap/*
cp -p /var/lib/ldap.backup/DB_CONFIG /var/lib/ldap/
startup ldap

then rerun your import
0
 
ee024Author Commented:
what import  do u mean to rerun migrate_all_offline.sh ?
0
 
martin_2110Commented:
yea.
0
 
ee024Author Commented:
Now all users can login...good...:-) i wonder y its not dynamic its really painful to run everything again and again is there any solution for this?
0
 
martin_2110Commented:
It is a migration script not a add user script. It is meant to be used once.
I use this to manage users.
http://lam.sourceforge.net/

I also use the attached script to add users sometimes. Make sure to replace ldapserver with your server.
#!/bin/bash
if [[ -z "$1" ]] ; then
    echo "usage: $0 username"
    exit 1
fi
 
LDAPSERVER=ldapserver
 
adduser $1
passwd $1
grep $1 /etc/passwd > /tmp/changeldappasswd.tmp
/usr/share/openldap/migration/migrate_passwd.pl /tmp/changeldappasswd.tmp /tmp/changeldappasswd.ldif.tmp
cat /tmp/changeldappasswd.ldif.tmp | sed s/dc=padl,dc=com/dc=example,dc=com/ > /tmp/changeldappasswd.ldif
echo >> /tmp/changeldappasswd.ldif
grep $1 /etc/group > /tmp/changeldappasswd.tmp
/usr/share/openldap/migration/migrate_group.pl /tmp/changeldappasswd.tmp /tmp/changeldappasswd.ldif.tmp
cat /tmp/changeldappasswd.ldif.tmp | sed s/dc=padl,dc=com/dc=example,dc=com/ >> /tmp/changeldappasswd.ldif
 
userdel $1
ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f /tmp/changeldappasswd.ldif -H ldap://$LDAPSERVER
rm -f /tmp/changeldappasswd.*

Open in new window

0
 
ee024Author Commented:
Thanks martin for everything.Have a good day :-)
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 10
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now