How to open nacos account password login

Nacos does not enable account and password login by default, but you can enable account and password login by modifying the configuration to enhance security. The following are the steps to enable account and password login in Nacos:

  1. Open the Nacos configuration file nacos/conf/application.properties.

  2. Add the following configuration to the file to set the username and password:

### Security ###
nacos.core.auth.enabled=true
nacos.core.auth.username=your_username
nacos.core.auth.password=your_password

Pay attention to
the reason why the authentication switch is not enabled in the new version of the configuration file. Specifically, you can modify the following configuration items and configure them as follows

nacos.core.auth.enabled=true
 
nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:example}
nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_KEY:example}
 
nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:SecretKey01234567890123456789012345345678999987654901234567890123456789}
  1. Replace your_usernamewith the username you want to set, and your_passwordreplace with the password you want to set.

  2. Save and close the configuration file.

  3. Restart the Nacos server to make the configuration take effect.

  4. When accessing the Nacos console, you will be asked to enter a user name and password for login verification.

Please ensure the security of your username and password, and avoid using weak passwords to protect your Nacos services.

In addition, Nacos also provides more security settings and permission control options, such as role-based permission control. You can find more detailed information in the official documentation: https://nacos.io/zh-cn/docs/security.html

To modify the Nacos account password through the configuration file, you can follow the steps below:

  1. Open the Nacos configuration file nacos/conf/application.properties.

  2. Add the following configuration and modify the username and password:

### Security ###
nacos.core.auth.enabled=true
nacos.core.auth.username=new_username
nacos.core.auth.password=new_password
  1. Replace new_usernamewith the new username you want to set and new_passwordreplace with the new password you want to set.

  2. Save and close the configuration file.

  3. Restart the Nacos server to make the configuration take effect.

Please note that when using the configuration file to modify the account password, you need to keep the configuration file carefully to avoid leaking sensitive information. At the same time, make sure the new username and password are safe enough to protect your Nacos service.

Guess you like

Origin blog.csdn.net/weixin_42279822/article/details/132215405