You are not logged in.

#1 2021-04-30 13:13:02

DemonLord
Member
Registered: 2021-04-21
Posts: 23

LDAP Cannot connect to the server

LDAP Cannot connect to the server


On the remote PC:

root@PC:~# ldapsearch -x -LLL  -H ldap:/// -b dc=myldap,dc=com

ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1) 

But on the Server with the same command it gives me info

root@server:~# ldapsearch -x -LLL  -H ldap:/// -b dc=myldap,dc=com

Here's ip addresses:

Server

172.16.0.7/24

Remote PC

172.16.0.9/24

They can ping each other, also there is no firewall rules

Hosts file /etc/hosts on Server

172.16.0.7 myldap.com server

And the same on the remote PC

Yes, i tried restart nscd service, here is output:

root@PC:~# systemctl status nscd
WARNING: terminal is not fully functional
-  (press RETURN)● nscd.service - Name Service Cache Daemon
     Loaded: loaded (/lib/systemd/system/nscd.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-04-30 15:58:44 EEST; 11min ago
    Process: 2769 ExecStart=/usr/sbin/nscd (code=exited, status=0/SUCCESS)
   Main PID: 2770 (nscd)
      Tasks: 10 (limit: 1106)
     Memory: 2.9M
     CGroup: /system.slice/nscd.service
             └─2770 /usr/sbin/nscd

apr   30 15:58:53 PC nscd[2770]: nss_ldap: failed to bind to LDAP server ldapi:///172.16.0.7: Can't contact LDAP server
apr   30 15:58:53 PC nscd[2770]: nss_ldap: reconnecting to LDAP server...
apr   30 15:58:53 PC nscd[2770]: nss_ldap: could not connect to any LDAP server as cn=admin,dc=myldap,dc=com - Can't contact LDAP server
apr   30 15:58:53 PC nscd[2770]: nss_ldap: failed to bind to LDAP server ldapi:///172.16.0.7: Can't contact LDAP server
apr   30 15:58:53 PC nscd[2770]: nss_ldap: reconnecting to LDAP server (sleeping 1 seconds)...
apr   30 15:58:54 PC nscd[2770]: nss_ldap: could not connect to any LDAP server as cn=admin,dc=myldap,dc=com - Can't contact LDAP server
apr   30 15:58:54 PC nscd[2770]: nss_ldap: failed to bind to LDAP server ldapi:///172.16.0.7: Can't contact LDAP server
apr   30 15:58:54 PC nscd[2770]: nss_ldap: could not search LDAP server - Server is unavailable

Output slapd on the server:

root@server:~# systemctl status slapd
WARNING: terminal is not fully functional
-  (press RETURN)● slapd.service - LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)
     Loaded: loaded (/etc/init.d/slapd; generated)
    Drop-In: /usr/lib/systemd/system/slapd.service.d
             └─slapd-remain-after-exit.conf
     Active: active (running) since Fri 2021-04-30 15:49:55 EEST; 21min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 745 ExecStart=/etc/init.d/slapd start (code=exited, status=0/SUCCESS)
      Tasks: 4 (limit: 1106)
     Memory: 5.9M
     CGroup: /system.slice/slapd.service
             └─803 /usr/sbin/slapd -h ldap:/// ldapi:/// -g openldap -u openldap -F /etc/ldap/slapd.d

apr   30 15:49:54 server systemd[1]: Starting LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)...
apr   30 15:49:55 server slapd[745]:  * Starting OpenLDAP slapd
apr   30 15:49:55 server slapd[768]: @(#) $OpenLDAP: slapd  (Ubuntu) (Apr  8 2021 04:22:01) $
                                             Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>
apr   30 15:49:55 server slapd[803]: slapd starting
apr   30 15:49:55 server slapd[745]:    ...done.
apr   30 15:49:55 server systemd[1]: Started LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol).

Server also listens the port (389):

root@server:~$ ss -tulnp
Netid                State                 Recv-Q                Send-Q                               Local Address:Port                                 Peer Address:Port                Process                
udp                  UNCONN                0                     0                                    127.0.0.53%lo:53                                        0.0.0.0:*                                          
udp                  UNCONN                0                     0                                          0.0.0.0:631                                       0.0.0.0:*                                          
udp                  UNCONN                0                     0                                          0.0.0.0:5353                                      0.0.0.0:*                                          
udp                  UNCONN                0                     0                                          0.0.0.0:39194                                     0.0.0.0:*                                          
udp                  UNCONN                0                     0                                             [::]:53862                                        [::]:*                                          
udp                  UNCONN                0                     0                                             [::]:5353                                         [::]:*                                          
tcp                  LISTEN                0                     1024                                       0.0.0.0:389                                       0.0.0.0:*                                          
tcp                  LISTEN                0                     4096                                 127.0.0.53%lo:53                                        0.0.0.0:*                                          
tcp                  LISTEN                0                     128                                        0.0.0.0:22                                        0.0.0.0:*                                          
tcp                  LISTEN                0                     5                                        127.0.0.1:631                                       0.0.0.0:*                                          
tcp                  LISTEN                0                     1024                                          [::]:389                                          [::]:*                                          
tcp                  LISTEN                0                     511                                              *:80                                              *:*                                          
tcp                  LISTEN                0                     128                                           [::]:22                                           [::]:*                                          
tcp                  LISTEN                0                     5                                            [::1]:631                                          [::]:*                  

I just want to login as user using ldap whom i created

Last edited by DemonLord (2021-04-30 13:14:53)

Offline

Board footer

Powered by FluxBB