Jenkins:如何更改LDAP密码 [英] Jenkins: How to Change LDAP Password
问题描述
我的机构要求我定期更改我的LDAP密码。
在过去,我可以执行以下步骤来更改我的密码: -
- 在 http://www.base64encode.org/ 创建Base64编码的密码
- 编辑
/var/lib/jenkins/config.xml
并更改< managerPassword />
。
但是,最新版本的Jenkins不再使用< managerPassword />
。相反,我看到< managerPasswordSecret />
。
我不知道如何生成新的秘密密码,所以我做了以下: -
- 备份
/var/lib/jenkins/config.xml
。 - 编辑
/var/lib/jenkins/config.xml
并更改<$ c $ - 重新启动Jenkins服务。
- 转到Jenkins。
- 启用LDAP安全性。
- 输入新的LDAP密码。
- 保存。
- 打开
/var/lib/jenkins/config.xml
并复制< managerPasswordSecret />
。 - 恢复备份配置文件。
这是令人难以置信的复杂。
有没有更直接的方式让我日后维持LDAP密码变更?
!
您仍然可以使用< managerPassword>。
-
使用
生成新的编码密码
perl -e'使用MIME :: Base64;在您的config.xml中,找到< hudson> /< securityRealm> /< managerPasswordSecret> ;,打印encode_base64(yourNewPassword);'
- 更改< managerPasswordSecret>到< managerPassword> (前后),并将#1的编码放在它们之间。
- 重新启动jenkins
- 登录并使用UI,将LDAP管理器密码重置为相同的NewPassword。 config.xml现在应该返回到< managerPasswordSecret>。
- 如果你是偏执的(像我一样),请重新启动jenkins以使用新修改的config.xml。
My institution requires me to periodically change my LDAP password.
In the past, I was able to perform the following steps to change my password:-
- Create a Base64 encoded password at http://www.base64encode.org/
- Edit
/var/lib/jenkins/config.xml
and change<managerPassword/>
.
However, the recent version of Jenkins no longer use <managerPassword/>
. Instead, I'm seeing <managerPasswordSecret/>
.
I'm not sure how to generate the new secret password, so I did the following:-
- Backup
/var/lib/jenkins/config.xml
first. - Edit
/var/lib/jenkins/config.xml
and change<useSecurity/>
tofalse
. - Restart Jenkins service.
- Go to Jenkins.
- Enable LDAP Security.
- Enter new LDAP password.
- Save it.
- Open up
/var/lib/jenkins/config.xml
and copy<managerPasswordSecret/>
. - Restore backup config file.
- Replace
<managerPasswordSecret/>
with the new value.
This is incredibly convoluted.
Is there a more straightforward way for me to maintain my LDAP password change in the future?
Thanks much!
You can still use <managerPassword>.
Generate the new encoded password with
perl -e 'use MIME::Base64; print encode_base64("yourNewPassword");'
In your config.xml, find <hudson>/<securityRealm>/<managerPasswordSecret>. Change <managerPasswordSecret> to <managerPassword> (both before and after) and put the encoding from #1 between them. Save the file.
- Restart jenkins
- Login and using the UI, reset the LDAP Manager password to the same yourNewPassword. config.xml should now be back to <managerPasswordSecret>.
- If you are paranoid (like me), restart jenkins again to use the newly modified config.xml.
这篇关于Jenkins:如何更改LDAP密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!