redis默认只允许本地访问,要使redis可以远程访问可以修改redis.conf
打开redis.conf文件在NETWORK部分有说明
################################## NETWORK #####################################
# By default, if no "bind" configuration directive is specified, Redis listens
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
#
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
#
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1
解决办法:注释掉bind 127.0.0.1可以使所有的ip访问redis
若是想指定多个ip访问,但并不是全部的ip访问,可以bind
注意
下面还有个说明
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
#
# When protected mode is on and if:
#
# 1) The server is not binding explicitly to a set of addresses using the
#    "bind" directive.
# 2) No password is configured.
#
# The server only accepts connections from clients connecting from the
# IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
# sockets.
#
# 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 yes
在redis3.2之后,redis增加了protected-mode,在这个模式下,即使注释掉了bind 127.0.0.1,再访问redisd时候还是报错,如下
(error) DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
修改办法:protected-mode no
转载自:https://www.cnblogs.com/liusxg/p/5712493.html

转载于:https://www.cnblogs.com/darknebula/p/8596190.html

【转载】redis开启远程访问相关推荐

  1. redis启动后 允许访问_解决Redis开启远程访问及密码问题

    Redis开启远程访问及密码,具体介绍如下所示: 一.开启远程访问 1.开放端口 firewall-cmd --zone=public --add-port=6379 firewall-cmd --z ...

  2. Redis开启远程访问,你需要注意这些问题

    redis默认只允许本地访问,要使redis可以远程访问可以修改redis.conf 注意事项:开启远程访问,一定要设置密码,否则服务器会被挖矿程序劫持,到时候找你要比特币,就难搞了~ 目录 一.注释 ...

  3. Redis开启远程访问及密码认证

    阅读目录 配置 redis.conf 文件 配置 redis.conf 文件 [root@localhost bin]# vi /usr/local/redis/bin/redis.conf 将 bi ...

  4. linux mysql开远程访问,Linux mysql开启远程访问

    默认情况下远程访问会出现 Can't connect to MySQL server on '192.168.10.18′ (10061) 错误 是因为,mysql的默认配置为了增强安全性,禁止了非本 ...

  5. mysql给root开启远程访问权限,修改root密码

    2019独角兽企业重金招聘Python工程师标准>>> mysql给root开启远程访问权限,修改root密码 2017年01月05日 14:36:12 服务器上修改: 忘记密码使用 ...

  6. Centos 7 mysql 5.7 给root开启远程访问权限,修改root密码

    Centos 7 mysql 5.7 给root开启远程访问权限,修改root密码 转载2016-05-13 15:08:15 1.MySql-Server 出于安全方面考虑只允许本机(localho ...

  7. redis开启外网访问

    redis默认只允许本地访问,要使redis可以远程访问可以修改redis.conf 打开redis.conf文件在NETWORK部分有说明 ############################# ...

  8. mysql tcp 远程_MySQL开启远程访问

    MySQL开启远程访问 首先开启防火墙端口 每个机器开启的命令不同: Firewall: 开启端口: firewall-cmd --permanent --add-port=3306/tcp 重新加载 ...

  9. centos mysql 访问_centos下mysql开启远程访问

    登录MySQL:  mysql -u root -p; 然后输入密码, 如需修改密码,第一次:  mysqladmin -u root password NEWPASSWORD 已设置过:  mysq ...

最新文章

  1. 使用Python的库qrcode生成二维码
  2. GitHub 发布了一款重量级产品,可直接运行代码
  3. iOS自定义组与组之间的距离以及视图
  4. asp.net mvc 2被遗忘的%:Html.AntiForgeryToken() %
  5. clickhouse 小结1
  6. 博客生活的另一种境界![博友话题]
  7. python导入dat数据_Kaggle影评数据集,Python数据分析小例子14
  8. 002.FTP配置项详解
  9. Android 平台视频播放器demo
  10. matlab 字符串 倒序,MATLAB tip
  11. android fastboot 刷机教程,已进入fastboot怎么刷机教程
  12. 【嵌入式技术期末复习要点】
  13. 请原谅我一生读题不仔细~仅以此纪念多校第十场1004
  14. 面经-腾讯前端开发工程师
  15. 深圳大学计算机与软件学院寝室照片,深圳大学宿舍(深圳大学宿舍真实照片)...
  16. hiveserver2 和beeline_Beeline连接Hiveserver2错误
  17. 002__Hive的tez引擎的配置步骤
  18. 成就你一生的100个哲理51-60
  19. 直播app平台搭建需要那些技术流程
  20. 工程导论第二章工程与科学

热门文章

  1. Selector SelectionKey
  2. LIVE555再学习 -- FFmpeg + live555实现RTSP直播
  3. Ubuntu断电重启后黑屏左上角光标闪烁,分辨率低解决办法
  4. Java throw:异常的抛出
  5. 权益证明协议中的拜占庭容错
  6. 从并发视角来看智能合约(上)【渡鸦论文系列】
  7. Linux 内核的文件 Cache 管理机制介绍
  8. wpf将文字转化为图形_工程师们开发出将天然气转化为固体的方法
  9. 韩信点兵python源代码_少儿编程|Python小课堂 – 韩信点兵
  10. 2台服务器虚拟存储,虚拟存储的主要用途