An example of Redis setting password protection

  • 2020-06-03 08:43:29
  • OfStack

When Redis is installed, it is not password protected by default, and password protected for security purposes.

 Log in locally on the client side The server  
[root@shanxi src]# ./redis-cli 
 View password. The current password is empty> config get requirepass 
1) "requirepass" 
2) "" 
 Set the password to  aabbcc> config set requirepass "aabbcc" 
 Check the password again, it shows insufficient permissions, need to log in again> config get requirepass 
(error) NOAUTH Authentication required.> exit 
 Log back in  
[root@shanxi src]# ./redis-cli 
 Verify password is  aabbcc> auth "aabbcc" 
 Check the password again   Is shown as  aabbcc  Yes, it worked> config get requirepass 
1) "requirepass" 
2) "aabbcc" 

Related articles: