Jenkins:如何更改LDAP密码 [英] Jenkins: How to Change LDAP Password

查看:1898
本文介绍了Jenkins:如何更改LDAP密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的机构要求我定期更改我的LDAP密码。



在过去,我可以执行以下步骤来更改我的密码: -





但是,最新版本的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>。


  1. 使用

    生成新的编码密码

    perl -e'使用MIME :: Base64;在您的config.xml中,找到< hudson> /< securityRealm> /< managerPasswordSecret> ;,打印encode_base64(yourNewPassword);'


  2. 更改< managerPasswordSecret>到< managerPassword> (前后),并将#1的编码放在它们之间。

  3. 重新启动jenkins

  4. 登录并使用UI,将LDAP管理器密码重置为相同的NewPassword。 config.xml现在应该返回到< managerPasswordSecret>。

  5. 如果你是偏执的(像我一样),请重新启动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:-

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/> to false.
  • 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>.

  1. Generate the new encoded password with

    perl -e 'use MIME::Base64; print encode_base64("yourNewPassword");'

  2. 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.

  3. Restart jenkins
  4. Login and using the UI, reset the LDAP Manager password to the same yourNewPassword. config.xml should now be back to <managerPasswordSecret>.
  5. If you are paranoid (like me), restart jenkins again to use the newly modified config.xml.

这篇关于Jenkins:如何更改LDAP密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆