Ldap

如何測試來自客戶端的 LDAP 連接

  • May 26, 2021

如何檢查從客戶端到伺服器的 LDAP 連接。我正在處理 LDAP 身份驗證,此客戶端桌面需要通過 LDAP 伺服器進行身份驗證。我可以使用 LDAP 使用者通過 SSH 連接到 LDAP 伺服器,但是在桌面登錄提示時,我無法登錄。它說身份驗證失敗。

客戶端機器有 Cent OS 6.3,LDAP 伺服器有 Cent OS 5.5

LDAP 軟體是 Openldap。

LDAP 伺服器日誌甚至不顯示任何消息。

那麼,如何測試客戶端是否可以成功連接到 LDAP。

使用 ldapsearch。如果您無法查詢 LDAP 伺服器,它將返回錯誤。

使用 ldapsearch 的語法:

ldapsearch -x -LLL -h [host] -D [user] -w [password] -b [base DN] -s sub "([filter])" [attribute list]

一個簡單的例子

$ ldapsearch -x -LLL -h host.example.com -D user -w password -b"dc=ad,dc=example,dc=com" -s sub "(objectClass=user)" givenName

請參閱此連結:http ://randomerror.wordpress.com/2009/10/16/quick-tip-how-to-search-in-windows-active-directory-from-linux-with-ldapsearch/

編輯:看來你沒有為 gdm/xdm 配置 pam 的 corectlly 這裡是一個例子如何做到這一點:http: //pastebin.com/TDK4KWRV

引用自:https://serverfault.com/questions/452935