Redis password change

1. Enter the Docker container

First, enter the Redis client in the Docker container. The code is as follows:

[root@localhost ~]# docker exec -it b9e507a86439 redis-cli

Among themb9e507a86439Is the Redis container ID in my Docker, using docker ps You can view the Redis ID in your own container



If Redis sets the password, you can enter the password (note that the password is a string form!).

127.0.0.1:6379> auth "set your own password"

Seeing the word OK means that you have successfully entered the Redis client



Improved Redis security (especially if your cloud server 6379 port is exposed) by setting the parameters of the configuration file in Redis and requiring the auth password to authenticate the connection.

2. Change your password

We can check if password authentication is set with the following command:

127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2)"

This is the parameter that configures the Redis access password. By default, the requirePass parameter is null, which means that you can connect to the Redis service without password authentication. Of course, you can modify this parameter with the following command:

127.0.0.1:6379> CONFIG set requirepass 127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) "config-if" 127.0.0.0.1:6379 > CONFIG set requirepass"

Once the password is set, using the Docker Restart Redis command will require password verification the next time a client connects to the Redis service, otherwise the command cannot be executed.

3, grammar,

The basic syntax format of the AUTH command is as follows:

127.0.0.1:6379 > AUTH password

RabbitMQ password change

Step 1: Enter the Docker container

docker exec -it myrabbitmq bash

Among them myrabbitmq Is the name of the RabbitMQ in its own container, available through docker ps Take a look, and replace the name in your own container

Step 2: View the list of current users

rabbitmqctl list_users

Display all users’ IDs and Tags

Step 3: Change your password

 rabbitmqctl  change_password  Username  'Newpassword' 

The specific code is explained as follows:

rabbitmqctl change_password Username 'Your NewPassword'

Parameter explanation:

If you want to change the password for admin, you can use "admin Your NewPassword" to write Your NewPassword

NACOS password change

Note: The author used the NACOS version 1.4.1, and there may be differences between different versions. Moreover, the Nacos declared in the author’s article is deployed in the Docker container, but the Docker container lacks the configuration file of Nacos compared with the local version of Nacos, so the modification method of the online webpage version is used. (Actually all password changes are achieved by modifying SQL files in the configuration file)

First, enter the Nacos page (default port number: 8848).

Enter the account password (Nacos comes with default account/password: Nacos/Nacos)

Click on the left side of permission control → user list



Click the Modify button

Confirm submission by entering a new password in the Confirm password field

Show UPDATE USER OK! This means that NACOS has successfully changed the password.