Last active
November 18, 2017 00:00
-
-
Save ashee/fcd8d2aece8b0c3239b9c102b8c57256 to your computer and use it in GitHub Desktop.
jenkins-genpwd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd ~/.jenkins | |
$ vim ~/users/ashee/config.xml | |
<passwordHash>#jbcrypt:xxxxxxxx</passwordHash> | |
$ jshell --class-path war/WEB-INF/lib/jbcrypt-1.0.0.jar | |
jshell> import org.mindrot.jbcrypt.* | |
jshell> BCrypt.hashpw("foo", BCrypt.gensalt()) | |
$8 ==> "$2a$10$jRnBX5Z/rT0cCRI1Dq1rh.RTb8fOzIfVQ7T9emsLMJLKaZUdro17i" | |
jshell> BCrypt.checkpw("foo", $8) | |
$9 ==> true | |
# replace <passwordHash> with the above |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment