This article to introduce to you about Redis access control, password Setup basic steps, there is a need to know friends do not enter the reference.
Redis as a high-speed database, on the Internet, must have a corresponding security mechanism to protect.
1. A more secure approach is to use a binding IP to control.
The code is as follows |
Copy Code |
Bind 127.0.0.1 |
Indicates that access is only allowed through the 127.0.0.1 IP address. In fact, only oneself can access himself, other machines can not access him.
This order is to be changed in redis.conf.
Please note here
The starting mode we use Src/redis-server
Switch
The code is as follows |
Copy Code |
Src/redis-server redis.conf |
Because it needs to load the configuration file.
This method is not very good, I would inevitably have more than one machine access to a Redis service
2. Set the password to provide remote login
The code is as follows |
Copy Code |
Redis.conf Found it Requirepass
|
Write on
Requirepass YourPassword Set the password later found can login, but unable to execute the command.
The code is as follows |
Copy Code |
Src/redis-cli-h 192.168.1.121 Keys * (Error) ERR Operation not permitted
|
Authorization commands
Auth 123456 Login with password mode
./redis-cli-h 192.168.1.121-a Hzhutid because the Redis concurrency is very strong, only the password, the attacker may send a large number of short-guessing password requests, it is easy to brute force, so it is recommended that the longer the password the better, such as 20-bit. (The password is clear in the Conf file, so don't worry about forgetting it)
http://www.bkjia.com/PHPjc/630681.html www.bkjia.com true http://www.bkjia.com/PHPjc/630681.html techarticle this article to introduce to you about Redis access control, password Setup basic steps, there is a need to know friends do not enter the reference. Redis as a high-speed database, on the Internet, ...