如何在 Windows 上重置 jenkins 的使用/密码?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39340322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to reset the use/password of jenkins on windows?
提问by Gabriel XU
Maybe a fool question, I installed jenkins on windows by default, have set no user/password, it worked at first, no need to login. But when launch the 8080 webpage now, it hangs the login page, I've tried some normal user/password combinations, none could pass. Also searched the resolution on website, only find some about linux, no about windows, so need help. jenkins login page
也许是一个愚蠢的问题,我默认在 Windows 上安装了 jenkins,没有设置用户/密码,它首先工作,不需要登录。但是现在启动8080网页时,它挂起登录页面,我尝试了一些普通的用户/密码组合,没有一个可以通过。也在网站上搜索了分辨率,只找到了一些关于linux的,没有关于windows的,所以需要帮助。 詹金斯登录页面
回答by Tuan
You can try to re-set your Jenkins security:
您可以尝试重新设置 Jenkins 安全性:
- Stop the Jenkins service
- Open the
config.xml
with a text editor (i.e notepad++), maybe be inC:\jenkins\config.xml
(could backup it also). - Find this
<useSecurity>true</useSecurity>
and change it to<useSecurity>false</useSecurity>
- Start Jenkins service
- 停止 Jenkins 服务
config.xml
用文本编辑器(即记事本++)打开,也许在C:\jenkins\config.xml
(也可以备份它)。- 找到这个
<useSecurity>true</useSecurity>
并将其更改为<useSecurity>false</useSecurity>
- 启动詹金斯服务
You might create an admin user and enable security again.
您可以创建一个管理员用户并再次启用安全性。
回答by user8225463
Read Initial password :
读取初始密码:
C:\Program Files(x86)\Jenkins\secrets\initialAdminPassword
Default username is 'admin'and the password is the one from initialAdminPassword when you follow the above path.
当您按照上述路径操作时,默认用户名是“admin”,密码是来自 initialAdminPassword 的密码。
'Manage Jenkins' --> 'Manage Users' --> Password
Then logout and login to make sure new password works.
然后注销并登录以确保新密码有效。
回答by Deepak
This is for windows environment:
这是针对windows环境的:
I got the Initial Admin password under C:\Users\Deepak("MyUser").jenkins\secrets\initialAdminPassword
我在 C:\Users\Deepak("MyUser").jenkins\secrets\initialAdminPassword 下得到了初始管理员密码
I was able to login with user "admin" and above password. Then under Jenkins> people I edited the password of the user and clicked on apply to reflect the changes.
我能够使用用户“admin”及以上密码登录。然后在 Jenkins> people 下,我编辑了用户的密码并单击应用以反映更改。
回答by Bruce wayne - The Geek Killer
I created a new user with "admin" and new password on the installation steps. But after sometime, i wanted to sign in again and that password was showing incorrect, so i used the initial password again to login.
我在安装步骤中使用“admin”和新密码创建了一个新用户。但是过了一段时间,我想再次登录,但密码显示不正确,所以我再次使用初始密码登录。
The initial password can be found in the below location:-
初始密码可以在以下位置找到:-
C:\Program Files(x86)\Jenkins\secrets\initialAdminPassword
try this method
试试这个方法
回答by PJ127
I had the same problem, no possible connection at second login.
我遇到了同样的问题,第二次登录时无法连接。
After solving the problem (useSecurity, etc., see above), I realized that admin/adminworked (with Synology, it that's relevant).
解决问题后(useSecurity 等,见上文),我意识到admin/admin工作(使用 Synology,这是相关的)。
回答by Gabriel XU
I got the initial password in the path C:\Program Files(x86)\Jenkins\secrets\initialAdminPassword
我在路径C:\Program Files(x86)\Jenkins\secrets\initialAdminPassword 中得到了初始密码
Then I login successfully with "administrator" as an user name.
然后我以“管理员”作为用户名成功登录。