Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of remote access and password enabled by Redis

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to solve the problem of Redis remote access and password. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Redis enables remote access and password, as shown below:

I. enable remote access

1. Open port

Firewall-cmd-zone=public-add-port=6379firewall-cmd-zone=public-add-port=6379-permanent

two。 View open ports

Firewall-cmd-list-port

3. Modify the configuration file

Vim redis.conf

Change the bind 127.0.0.1 comment or change to bind 0.0.0.0

Change protected-mode yes to protected-mode no

Second, set the password

Find # requirepass foobared to remove the comments and change foobared to the password you want, such as requirepass 123456

Then restart it.

Systemctl restart redis

Ps:Redis initiates error reporting solution

Error

Redis_6379.service-LSB: start and stop redis_6379

Loaded: loaded (/ etc/rc.d/init.d/redis_6379; bad; vendor preset: disabled)

Active: active (exited) since Wed 2019-09-18 15:40:08 CST; 7s ago

Docs: man:systemd-sysv-generator (8)

Process: 22652 ExecStop=/etc/rc.d/init.d/redis_6379 stop (code=exited, status=0/SUCCESS)

Process: 22692 ExecStart=/etc/rc.d/init.d/redis_6379 start (code=exited, status=0/SUCCESS)

Sep 18 15:40:08 ythzcpt-csmh systemd [1]: Starting LSB: start and stop redis_6379...

Sep 18 15:40:08 ythzcpt-csmh redis_6379 [22692]: / var/run/redis_6379.pid exists, process is already running or crashed

Sep 18 15:40:08 ythzcpt-csmh systemd [1]: Started LSB: start and stop redis_6379.

Delete pid files

Cd / var/run mv redis_6379.pid redis_6379.pid_bak

Delete dump.rdb (memory snapshot) files

Cd / var/lib/redis/6379 mv dump.rdb dump.rdb_bak

> then check to see if there are any more redis services started

Ps-ef | grep redis kill-9

Reboot after that

This is the end of the article on "how to solve the problem of Redis remote access and password". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report