操作環境
- Nexus 版本:3.16.1-02
- LDAP類型: Active Directory
配置步驟
登錄nexus管理賬戶,進入配置界面

依次點擊Security>>LDAP進入配置頁面

點擊 “Create Connection” 創建LDAP連接

name:此連接的名稱,可自定義
LDAP server address
Protocol:是否啟用SSL,是選用 LDAPS,否則選用 LDAP
Hostname:LDAP的服務器地址
Port:LDAP端口號
Search base:基本DN,即一般從域的根節點開始搜索,如 dc=test,dc=com
Authentication method:加密方式
Username or DN:輸入用於獲取LDAP用戶的賬戶,建議使用只讀賬戶
用戶名:格式為 用戶名@域名,如 userget@test.com
password:輸入用戶的密碼
Connection rules:連接規則
第一個選框:超時時間,單位 秒
第二個選框:多少秒后重試
第三個選框:失敗嘗試次數
服務器信息填寫完成后,點擊 Verify connection 測試連接

右上角彈出測試結果,如測試連接失敗,請檢查配置信息是否有誤
測試成功后,點擊 next 進入LDAP 用戶和組配置
- 情景一:所有用戶都在 Users 根節點下
- 選擇 Configuration template 為 Active Directory,所有配置默認即可

- 選擇 Configuration template 為 Active Directory,所有配置默認即可
- 情景二:大部分用戶在Users目錄中,但還有其他目錄存在用戶
- 選擇 Configuration template 為 Active Directory
- 勾選 User subtree 下的復選框
- 其他配置信息默認

- 情景三:其他情況
- 選擇 Configuration template 為 Active Directory
- 去掉 Base DN默認值
- 勾選 User subtree 下的復選框
- 輸入User fitter,值為:(&(objectCategory=Person)(sAMAccountName=*))

點擊 Verify user mapping 測試獲取用戶列表

點擊 Verify login 測試ldap 用戶登錄


點擊 Save 保存,退出當前用戶,使用LDAP用戶登錄,配置完成。
官方配置文檔:https://help.sonatype.com/repomanager3/security/ldap#app/
