We can set a profile password by redis parameters, such redis client to connect to the service you need password authentication, so you can make your redis services more secure.
Examples
You see if we can set up password authentication using the following command:
127.0.0.1:6379> CONFIG get requirepass
1) "requirepass"
2) ""
The default parameters requirepass case is empty, which means you do not pass password authentication to connect to redis service.
You can modify the parameters by the following command:
127.0.0.1:6379> CONFIG set requirepass "runoob" OK 127.0.0.1:6379> CONFIG get requirepass 1) "requirepass" 2) "runoob"
After setting the password, the client connection redis service you need password authentication, or can not execute the command.
grammar
AUTH command basic syntax is as follows:
127.0.0.1:6379> AUTH password
Examples
127.0.0.1:6379> AUTH "runoob" OK 127.0.0.1:6379> SET mykey "Test value" OK 127.0.0.1:6379> GET mykey "Test value"