当前位置:网站首页>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 服務後,會發現系統允許匿名登錄,並且可以進行任何操作。
參考資料
边栏推荐
- How to use information mechanism to realize process mutual exclusion, process synchronization and precursor relationship
- PHP - Common magic method (nanny level teaching)
- Restore backup data on S3 compatible storage with tidb lightning
- Nft智能合约发行,盲盒,公开发售技术实战--拼图篇
- Introduction to number theory (greatest common divisor, prime sieve, inverse element)
- synchronized 解决共享带来的问题
- "Friendship and righteousness" of the center for national economy and information technology: China's friendship wine - the "unparalleled loyalty and righteousness" of the solidarity group released th
- Entity class design for calculating age based on birthday
- 备份与恢复 CR 介绍
- JS select all and tab bar switching, simple comments
猜你喜欢
ESP系列引脚说明图汇总
指针和数组笔试题解析
在 uniapp 中使用阿里图标
22. Empty the table
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
让学指针变得更简单(三)
Make learning pointer easier (3)
"Designer universe" Guangdong responds to the opinions of the national development and Reform Commission. Primary school students incarnate as small community designers | national economic and Informa
"Designer universe" APEC design +: the list of winners of the Paris Design Award in France was recently announced. The winners of "Changsha world center Damei mansion" were awarded by the national eco
Online yaml to CSV tool
随机推荐
PHP - Common magic method (nanny level teaching)
Configuring OSPF load sharing for Huawei devices
P3047 [usaco12feb]nearby cows g (tree DP)
TiDB备份与恢复简介
What are the ways to download network pictures with PHP
MFC sends left click, double click, and right click messages to list controls
Secure captcha (unsafe verification code) of DVWA range
Data governance: Data Governance under microservice architecture
"Designer universe" APEC design +: the list of winners of the Paris Design Award in France was recently announced. The winners of "Changsha world center Damei mansion" were awarded by the national eco
The resources of underground pipe holes are tight, and the air blowing micro cable is not fragrant?
Char to leading 0
Introduction to backup and recovery Cr
matplotlib. Widgets are easy to use
Wincc7.5 download and installation tutorial (win10 system)
Entity class design for calculating age based on birthday
Data governance: data quality
[cloud native] teach you how to build ferry open source work order system
Understanding of law of large numbers and central limit theorem
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
[research materials] 2021 China online high growth white paper - Download attached