gpt4 book ai didi

linux - LDAP 监听本地主机但主机名或 IP

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:48:16 28 4
gpt4 key购买 nike

我在运行 Raspian 的 raspberryPI 上安装了 LDAP,我认为它是 Debian 的分支。

我有一个数据库和条目,如果我使用 -h localhost 或 -h 127.0.0.1,我可以从服务器成功地进行 LDAP 搜索。但是,如果我使用主机名或 IP,我会收到一条错误消息:

root@rpi1:~# ldapsearch -d 1 -x -h 10.10.0.11 -b "ou=Groups,dc=pi,dc=home"
ldap_create
ldap_url_parse_ext(ldap://10.10.0.11)
ldap_sasl_bind
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 10.10.0.11:389
ldap_new_socket: 4
ldap_prepare_socket: 4
ldap_connect_to_host: Trying 10.10.0.11:389
ldap_pvt_connect: fd: 4 tm: -1 async: 0
attempting to connect:
connect errno: 111
ldap_close_socket: 4
ldap_err2string
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

对我来说奇怪的是服务正在监听端口:

    root@rpi1:~# nmap 10.10.0.11

Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-30 22:16 UTC
Nmap scan report for rpi1.pi.home (10.10.0.11)
Host is up (0.00017s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
636/tcp open ldapssl

Nmap done: 1 IP address (1 host up) scanned in 26.78 seconds
root@rpi1:~#
root@rpi1:~#
root@rpi1:~#
root@rpi1:~#
root@rpi1:~# nmap localhost

Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-30 22:17 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00018s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 996 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
389/tcp open ldap
636/tcp open ldapssl

Nmap done: 1 IP address (1 host up) scanned in 26.82 seconds

您可以看到扫描 localhost 显示该服务正在监听 389,但如果我使用服务器的 IP 或主机名则不会。

所以我无法让另一台服务器上的客户端进行连接,因为它似乎只在本地主机上监听......恐怕这超出了我有限的理解范围。

据我所知,我正在解析名称 ok:

root@rpi1:~# host rpi1
rpi1 has address 10.10.0.11

root@rpi1:~# host rpi1.pi.home
rpi1.pi.home has address 10.10.0.11

root@rpi1:~# host ldap.pi.home
ldap.pi.home has address 10.10.0.11

数据库正在运行的证明:

root@rpi1:~# ldapsearch -x -h 127.0.0.1 -b "cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home"
# extended LDIF
#
# LDAPv3
# base <cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# Bradley Atkins, musedev, Groups, pi.home
dn: cn=Bradley Atkins,cn=musedev,ou=Groups,dc=pi,dc=home
cn: Bradley Atkins
givenName: Bradley
gidNumber: 501
homeDirectory: /home/users/batkins
sn: Atkins
loginShell: /bin/sh
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
uidNumber: 1001
uid: batkins

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

谁能提出前进的方向?

谢谢

最佳答案

nmap 输出清楚地显示,它在 127.0.0.1 上监听,而不是 0.0.0.0。

关于linux - LDAP 监听本地主机但主机名或 IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34538299/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com