As a high-speed database, redis must have a corresponding security mechanism on the Internet for protection. 1. the safer method is to bind an IP address for control. The code is as follows: bind127.0.0.1 indicates that only 127.0.0 is allowed .... as a high-speed database, redis must have a corresponding security mechanism on the Internet for protection.
1. the safer method is to bind an IP address for control. The code is as follows:
Bind 127.0.0.1
Allow access only through the IP address 127.0.0.1. In fact, only you can access yourself. other machines cannot access him. This command is required to go to redis. conf. Note that the common startup method src/redis-server is changed:
Src/redis-server redis. conf
Because it needs to load the configuration file, this method is not very good, I will inevitably have multiple machines to access a redis service.
2. set a password to provide remote login. the code is as follows:
Redis. conf find requirepass and write it
Requirepass yourpassword can be logged on after the password is set, but the command cannot be executed. the code is as follows:
Src/redis-cli-h 192.168.1.121
Keys *
(Error) ERR operation not permitted
Authorization command
Auth 123456 login with password
. /Redis-cli-h 192.168.1.121-a hzhutid due to redis's strong concurrency capability, attackers may send a large number of password-guessing requests in a short period of time, which is prone to brute force cracking, therefore, we recommend that you keep the password as long as possible. for example, if the password is 20 characters long, the password is in plain text in the conf file.
Tutorial address:
Reprinted! But please include the article address ^