当前位置:网站首页>LDAP應用篇(4)Jenkins接入
LDAP應用篇(4)Jenkins接入
2022-07-06 08:18:00 【雨帝夜淚】
LDAP應用篇(4)Jenkins接入
配置 Jenkins 接入 LDAP 時需要慎重一些,因為一旦在配置中啟用了LDAP驗證用戶之後,會導致之前的用戶無法登錄,包括 admin 賬戶。
證書配置
如果 Jenkins 通過 ldaps 接入 ,必須單獨配置 java 運行環境的證書。如果使用 ldap 協議接入,則可跳過此部分。
下載及導入
證書的配置,只需要兩步,即下載和導入即可。在導入時,根據不同的jdk版本比特置會略有不同,尤其是 jdk11 以上的版本,已經沒有了 jre 目錄,請注意!
openssl s_client -connect <address>:636 >> host.crt
keytool -import -trustcacerts -alias <address> -file host1.crt -keystore /usr/java/jdk-17.0.3.1/lib/security/cacerts
在導入證書時,需要輸入證書密碼,該密碼默認為: changeit 。其實這個怎麼來的並不知道,似乎大家都是這麼用的~~~
有些文檔會先清除下載證書中的 BEGIN CERTIFICATE 和 END CERTIFICATE 內容,但是根據實測,並不需要這些操作。
Jenkins 中的配置
安全配置
進入 全局安全配置 中,按照網上的一般操作填寫信息即可,注意如下兩項: User search base 及 Group search base ,錶示用戶和組的搜索起點,這裏不要輸入完整的DN信息,只需要輸入用戶和組的最後一節 ou 即可。
Display Name LDAP attribute 一項用於顯示用戶名,但是一般的 posixAccount 賬戶並沒有此屬性,可以改為 cn 屬性。
修改後不要直接保存,一定要點擊 Test LDAP settings 按鈕,確認無誤後方可保存!!!
基於角色的矩陣授權
基於角色的矩陣授權這裏也不再贅述,只是在上一步配置了LDAP之後,一定要在這裏的 Assign Roles 頁面的 Global roles 中,確保至少有一個用戶具備 admin 角色。這樣才能保證該用戶可以正常管理 Jenkins。
故障修複
正如開頭部分所說,如果萬一修改時發生意外,導致無法登錄,也可以通過下面的方法進行修複。在Jenkins目錄中查找 config.xml 文件,如果配置了環境變量 JENKINS_HOME ,文件可能在指定的目錄中。打開該文件,配置下面的內容為 false :
<useSecurity>flase</useSecurity>
重啟 Jenkins 服務後,會發現系統允許匿名登錄,並且可以進行任何操作。
參考資料
边栏推荐
猜你喜欢

Summary of phased use of sonic one-stop open source distributed cluster cloud real machine test platform
![[research materials] 2021 live broadcast annual data report of e-commerce - Download attached](/img/a6/74da2f44c7b6b22fed2f8e41a55988.jpg)
[research materials] 2021 live broadcast annual data report of e-commerce - Download attached

A Closer Look at How Fine-tuning Changes BERT

Asia Pacific Financial Media | "APEC industry +" Western Silicon Valley invests 2trillion yuan in Chengdu Chongqing economic circle to catch up with Shanghai | stable strategy industry fund observatio

wincc7.5下载安装教程(Win10系统)
![[t31zl intelligent video application processor data]](/img/67/b77c1de990d9b8868f8df5e55b0227.png)
[t31zl intelligent video application processor data]

Chinese Remainder Theorem (Sun Tzu theorem) principle and template code

Online yaml to CSV tool

Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation

Analysis of pointer and array written test questions
随机推荐
在 uniapp 中使用阿里图标
远程存储访问授权
Migrate data from CSV files to tidb
Make learning pointer easier (3)
[Yugong series] creation of 009 unity object of U3D full stack class in February 2022
华为云OBS文件上传下载工具类
C language - bit segment
Wincc7.5 download and installation tutorial (win10 system)
Upgrade tidb with tiup
【T31ZL智能视频应用处理器资料】
1202 character lookup
Data governance: metadata management
Résumé des diagrammes de description des broches de la série ESP
[redis] Introduction to NoSQL database and redis
Epoll and IO multiplexing of redis
Image fusion -- challenges, opportunities and Countermeasures
C语言 - 位段
Yyds dry goods inventory three JS source code interpretation eventdispatcher
Golang DNS write casually
Pyqt5 development tips - obtain Manhattan distance between coordinates