У меня есть 2 виртуальные машины VMware, каждая из которых работает под управлением Windows Server 2017 (Server Core) Build 17046. Я использую VMware.
ВМ № 1 имеет доступ к клиент - Сетевой адаптер 1 ВМ №1 также имеет доступ к частной сети (VMnet10) - Сетевой адаптер 2
ВМ №2 имеет доступ ТОЛЬКО к частной сети (VMnet10) - Сетевой адаптер 1 Я предоставил контроль доступа в моем slapd.conf следующим образом:
access to *
by self write
by * read
by anonymous auth
Код:
require 'net/ldap'
con = Net::LDAP.new
con.host = 'localhost'
con.port = 389
con.auth 'cn=user,dc=example,dc=com', '123'
if con.bind
# authentication succeeded
puts 'success'
puts con.get_operation_result
else
# authentication failed
puts 'fail'
puts con.get_operation_result
# p con.get_operation_result
end
Ошибка:
5a3e8945 >>> dnPrettyNormal: <cn=user,dc=example,dc=com>
5a3e8945 <<< dnPrettyNormal: <cn=user,dc=example,dc=com>, <cn=user,dc=example,dc=com>
5a3e8945 do_bind: version=3 dn="cn=user,dc=example,dc=com" method=128
5a3e8945 bdb_dn2entry("cn=user,dc=example,dc=com")
5a3e8945 => bdb_dn2id("dc=example,dc=com")
5a3e8945 <= bdb_dn2id: got id=0x5
5a3e8945 => bdb_dn2id("cn=user,dc=example,dc=com")
5a3e8945 <= bdb_dn2id: got id=0x17
5a3e8945 entry_decode: "cn=user,dc=example,dc=com"
5a3e8945 <= entry_decode(cn=user,dc=example,dc=com)
5a3e8945 => bdb_search
5a3e8945 bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com")
5a3e8945 => bdb_dn2id("cn=config,dc=example,dc=com")
5a3e8945 <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
5a3e8945 entry_decode: "dc=example,dc=com"
5a3e8945 <= entry_decode(dc=example,dc=com)
5a3e8945 send_ldap_result: conn=-1 op=0 p=0
5a3e8945 Entry *odusers_copy_entry(Operation *): Unable to locate cn=kerberoskdc,cn=config,dc=example,dc=com (32)
5a3e8945 odusers_copy_krbrealm: No entry associated with KerberosKDC cn=kerberoskdc,cn=config,dc=example,dc=com
5a3e8945 odusers_krb_auth: could not retrieve krb realm while authing user
5a3e8945 send_ldap_result: conn=1000 op=0 p=3
5a3e8945 send_ldap_response: msgid=1 tag=97 err=50
Я не вижу ошибки «недостаточные права доступа», но вижу эту ошибку:
5a3e8945 bdb_dn2entry("cn=kerberoskdc,cn=config,dc=example,dc=com")
5a3e8945 => bdb_dn2id("cn=config,dc=example,dc=com")
5a3e8945 <= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
, которая может быть связана с этими записями:
cn=config,dc=example,dc=com
cn=kerberoskdc,cn=config,dc=example,dc=com
Есть ли она в вашем База данных LDAP?