Home > Java > javaTutorial > Jenkins tutorial to change administrator password

Jenkins tutorial to change administrator password

PHP中文网
Release: 2017-06-20 14:41:23
Original
3685 people have browsed it

Foreword: Jenkins changed the administrator password. I read all the tutorials on the Internet, and all of them replaced the config with a string of encrypted ciphertext of 111111. The password in the xml file, and everyone’s password is 111111! I think this approach is too perfunctory! So I did some research, including the encryption method of Jenkins password and how to change the administrator's password. Of course, it is also a good choice to register a user by configuring Jenkins to allow registered users.

1. Jenkies’ encryption method

Jenkins’ password uses the Java encryption and decryption tool jBCrypt. This is the first time I have come into contact with this encryption method, and I am really amazed by it! This encryption method gets different results every time it encrypts the same plaintext. So how does it decrypt it? It turns out that he took the user's plaintext and the stored ciphertext to regenerate a string of ciphertext for judgment. To summarize, it has the following characteristics:                        

About bcrypt:  

 

1. bcrypt is an irreversible encryption algorithm, and the plaintext cannot be obtained by decrypting the ciphertext.

2. The difference between bcrypt and other symmetric or asymmetric encryption methods is that it does not directly decrypt to obtain the plaintext, nor does it perform secondary encryption to compare the ciphertext. Instead, it combines the plaintext with the stored ciphertext. A block of text operations is used to obtain another ciphertext. If the two ciphertexts are the same, the verification is successful.

3. The encryption results for the same plaintext are generally different.
Attached is the Java source code
import org.mindrot.jbcrypt.BCrypt;/**
 * Created by Administrator on 2017/6/2.
 * <p>
 * Description: */public class Test
{public static void main(String[] args)
    {//这是加密方式String hashed = BCrypt.hashpw("nimda", BCrypt.gensalt());
        System.out.println(hashed);//这是解密方式if (BCrypt.checkpw("nimda", hashed))
            System.out.println("It matches");elseSystem.out.println("It does not match");
    }
}
Copy after login

2, change the Jenkins admin password

##3. Restart Jenkins and you can see the modification effect.

http://localhost:8080/restart

The above is the detailed content of Jenkins tutorial to change administrator password. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template