Redis password settings, access permission control, and other security 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.
Copy codeThe 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, and no other machine can access him.

This command must be modified in redis. conf.

Note that

Common Startup Methods: src/redis-server

Change to src/redis-server redis. conf

Because it needs to load the configuration file.

This method is a little bad. I will inevitably have multiple machines accessing a redis service.

2. Set a password to provide remote login

Redis. conf
Find
Requirepass
Write
Requirepass yourpassword
After setting the password, you can log on, but you cannot execute the command.
Copy codeThe Code is as follows:
Src/redis-cli-h 192.168.1.121
Keys *
(Error) ERR operation not permitted
Authorization command
Copy codeThe Code is as follows: auth 123456
Login with Password
Copy codeThe Code is as follows:./redis-cli-h 192.168.1.121-a abcd
Because redis is highly concurrent and only engaged in passwords, 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 the longer the password, the better, for example, 20 characters. (The password is in plain text in the conf file, so you don't have to worry about forgetting it)

Related Article

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.