apt-get安装redis并配置远程访问

sudo apt update sudo apt install redis-server 

安装成功后默认启动redis服务,修改redis配置文件

sudo vim /etc/redis/redis.conf

注解掉bind 127.0.0.1 ::1

# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#bind 127.0.0.1 ::1

再将protected-mode设置为no

# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode no
# Linux 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×