歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 用ldapsearch驗證LDAP認證信息

用ldapsearch驗證LDAP認證信息

日期:2017/3/1 15:36:06   编辑:關於Linux
用ldapsearch驗證LDAP認證信息 企業裡面各種各樣的系統,堆積多了以後帳號數不勝數,比較好的解決方案之一是用LDAP。不過Microsoft的ActiveDirectory認證是否成功需要有命令來進行驗證,可以通過ldapsearch命令。 首先在Ubuntu上安裝: [plain] apt-get install ldap_utils 然後該命令就可以運行了。看個例子: [plain] root@gitlab:~# ldapsearch -p 389 -h $ldapHost -D "CN=$firstName $lastName,OU=China,OU=International,OU=Offices,DC=esri,DC=com" -w "$pwd" -b "DC=esri,DC=com" -x "sAMAccountName=$loginName" -p 端口號 -h LDAP server的域名 -D binddn, 這個需要從LDAP管理員那裡獲得, 並且注意CN=$firstName $lastName 是你在Active Directory上的用戶名稱,first name和last name binddn Use the Distinguished Name binddn to bind to the LDAP directory. For SASL binds, the server is expected to ignore this value. -w 後面跟password,要用""括起來 -b search base,也要從LDAP管理員那裡獲取 Use searchbase as the starting point for the search instead of the default. -x 後面接用戶名,sAMAccountName不能修改 Use simple authentication instead of SASL. 執行後如果獲得信息,那麼說明配置正確,可以將配置復制到需要連接LDAP的系統服務中。
Copyright © Linux教程網 All Rights Reserved