jenkins修改admin密码(jenkins忘记admin密码)

系统+安全 Liemer_Lius 1457℃ 0评论

1、找到JENKINS_HOME的位置,可以在jenkins的配置文件上找到:

# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins
# cd /etc/sysconfig/jenkins
-bash: cd: /etc/sysconfig/jenkins: 不是目录
# vim /etc/sysconfig/jenkins
# grep "JENKINS_HOME" /etc/sysconfig/jenkins
JENKINS_HOME="/var/lib/jenkins"
# permissions of $JENKINS_HOME and /var/log/jenkins.
[root@Master admin]# ls /var/lib/jenkins/users/admin/
config.xml

2、将config.xml中的密码代码改一下:

<passwordHash>#jbcrypt:$2a$10$DdaWzN64JgUtLdvxWIflcuQu2fgrrMSAMabF5TSrGK5nXitqK9ZMS</passwordHash>

3、以上内容的明文密码是:111111,重启jenkins,并用新密码登录admin即可。

转载请注明:liutianfeng.com » jenkins修改admin密码(jenkins忘记admin密码)

喜欢 (0)

发表回复