Open Redis port for remote connections

后端 未结 10 2035
隐瞒了意图╮
隐瞒了意图╮ 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 11:02

    1. Open $REDIS_HOME/redis.conf and uncomment requirepass -YOUR-PASSWORD-HERE- and write down your password in the specified lines.

    2. Login to redis using redis-cli and verify your password in the database using auth -YOUR-PASSWORD-HERE- command.

    3. Disable protected mode by changing its string in $REDIS_HOME/redis.conf to protected-mode no.

    4. Search for all bind ports values and comment all of them. Just add bind 0.0.0.0 to $REDIS_HOME/redis.conf file.

    5. Disable your firewall or open redis port.

    6. Start redis using ./redis-server $REDIS_HOME/redis.conf.

    7. Check the configuration via ./redis-cli -h -YOUR-IP- -a -YOUR-PASSWORD-HERE-.

    8. Check the configuration via ./redis-cli -h -YOUR-IP- ping.

提交回复
热议问题