Jenkins administrator password and jenkins administrator password
Preface:Jenkins changed the administrator password. After reading all the tutorials on the Internet, all of them were replaced with a string of encrypted 111111 ciphertext. the password in the xml file, and the password is 111111! I think this is really perfunctory! So I studied the Jenkins password encryption method and how to modify the administrator password. Of course, by configuring Jenkins to allow users to register and register a user, it is also a good choice.
1. Jenkies Encryption Method
The Jenkins password uses the Java encryption and decryption tool jBCrypt. I was the first to come into contact with this encryption method. He was amazed at it! Every time the same plaintext is encrypted, this encryption method returns different results. How does one decrypt the same plaintext? It turns out that he uses the user's plaintext and the stored ciphertext to re-generate a string of ciphertext to judge. It has the following features:
About bcrypt:
1. bcrypt is an irreversible encryption algorithm and cannot obtain plaintext through ciphertext decryption.
2. Different from other symmetric or asymmetric encryption methods, bcrypt does not directly decrypt the plaintext, nor compares the ciphertext with the secondary encryption. Instead, it computes the plaintext and the stored ciphertext to another ciphertext, if the two ciphertext values are the same, the verification is successful.
3. Encryption results for the same plaintext are generally different. Add the Java source code
Import org. mindrot. jbcrypt. BCrypt;/*** Created by Administrator on login /6/2. * <p> * Description: */public class Test {public static void main (String [] args) {// This is the encryption method String hashed = BCrypt. hashpw ("nimda", BCrypt. gensalt (); System. out. println (hashed); // This is the decryption method if (BCrypt. checkpw ("nimda", hashed) System. out. println ("It matches"); else System. out. println ("It does not match ");}}
2Modify the admin password of Jenkins
3. Restart Jenkins to see the Modification result.
Http: // localhost: 8080/restart