Is there a way to reset all (or just disable the security settings) from the command line without a user/password as I have managed to completely lock myself out of Jenkins
?
相关问题
- Is shmid returned by shmget() unique across proces
- “Zero out” sensitive String data in Swift
- how to get running process information in java?
- High cost encryption but less cost decryption
- Error building gcc 4.8.3 from source: libstdc++.so
One other way would be to manually edit the configuration file for your user (e.g. /var/lib/jenkins/users/username/config.xml) and update the contents of passwordHash:
Once you have done this, just restart Jenkins and log in using this password:
In order to remove the by default security for jenkins in Windows OS,
You can traverse through the file Config.xml created inside /users/{UserName}/.jenkins.
Inside this file you can change the code from
To,
1 first check location if you install war or Linux or windows based on that
for example if war under Linux and for admin user
go to this tag after #jbcrypt:
change this password using use any website for bcrypt hash generator
make sure it start with $2a cause this one jenkens uses
The
<passwordHash>
element inusers/<username>/config.xml
will accept data of the formatSo, if your salt is
bar
and your password isfoo
then you can produce the SHA256 like this:You should get
7f128793bc057556756f4195fb72cdc5bd8c5a74dee655a6bfb59b4a4c4f4349
as the result. Take the hash and put it with the salt into<passwordHash>
:Restart Jenkins, then try logging in with password
foo
. Then reset your password to something else. (Jenkins uses bcrypt by default, and one round of SHA256 is not a secure way to store passwords. You'll get a bcrypt hash stored when you reset your password.)Easy way out of this is to use the admin psw to login with your admin user:
sudo su -
xclip -sel clip < /var/lib/jenkins/secrets/initialAdminPassword
ctrl + v
on password input box.Install xclip if you don't have it:
$ sudo apt-get install xclip
The simplest solution is to completely disable security - change
true
tofalse
in/var/lib/jenkins/config.xml
file.Then just restart Jenkins, by
And then go to admin panel and set everything once again.