一、使用代码工具生成修改nacos默认密码
/** * @author arunyang * Ref: https://nacos.io/zh-cn/docs/console-guide.html * Reference: https://stackoverflow.com/questions/25844419/why-bcryptpasswordencoder-from-spring-generate-different-outputs-for-same-input */ public class PasswordEncoderUtil { // spring 4.0.0 public static void main(String[] args) { org.springframework.security.crypto.password.PasswordEncoder encoder = new org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder(); //(1) "123456" - plain text - user input from user interface String passwd = encoder.encode("Eixxxxw"); //(2) passwd - password from database System.out.println(passwd); // print hash //(3)验证: System.out.println(encoder.matches("Eixxxxw", passwd)); //(4)修改nacos密码: //INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2asdf8vRl4EixxxxwEixxxxwmCTZjDEixxxxwEixxxxwEixxxxwEixxxxwKTmoxgVzDrW', TRUE); //INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN'); } }
标签:修改,passwd,nacos,默认,encoder,密码,006nacos,password From: https://www.cnblogs.com/itcomputer/p/17212385.html