Redis access control and password settings

Source: Internet
Author: User
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 ^

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.