Open Redis port for remote connections

后端 未结 10 2046
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 10:00

I can ping pong Redis on the server:

# redis-cli ping
PONG

But remotely, I got problems:

$ src/redis-cli -h REMOTE.IP ping
         


        
10条回答
  •  天涯浪人
    2020-12-07 10:57

    Did you set the bind option to allow remote access on the redis server?

    Before (file /etc/redis/redis.conf)

    bind 127.0.0.1
    

    After

    bind 0.0.0.0
    

    and run sudo service redis-server restart to restart the server. If that's not the problem, you might want to check any firewalls that might block the access.

    Important: If you don't use a firewall (iptables, ufw..) to control who connects to the port in use, ANYONE can connect to this Redis instance. Without using Redis' AUTH that means anyone can access/change/delete your data. Be safe!

提交回复
热议问题