Skip to content

Instantly share code, notes, and snippets.

@ashee
Last active November 18, 2017 00:00
Show Gist options
  • Save ashee/fcd8d2aece8b0c3239b9c102b8c57256 to your computer and use it in GitHub Desktop.
Save ashee/fcd8d2aece8b0c3239b9c102b8c57256 to your computer and use it in GitHub Desktop.
jenkins-genpwd
$ 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