默认安装启动redis后,只能本地连接,无法远程连接上,原因是redis安全策略默认本机访问,所以远程访问的话需要将

配置文件redis.cof 中的 bind 127.0.0.1 前面的#注释掉,

有时仅仅注释掉这些还不行,因为新版本增加了保护模式,具体提示信息
    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.
虽然可以将保护模式设为no来关闭,但为了安全还是推荐设权限密码:
找到这一行# requirepass foobared,将#去掉并把foobared改成你的密码即可。
 

Redis允许远程连接的更多相关文章

  1. 阿里云部署Redis服务器远程连接问题

    昨天在阿里云免费领了一个月的云服务器,就着最近学的SpringBoot,准备做一个SpringBoot与Redis的整合. 因为以前用的Redis都是安装在本地的,使用过程中没遇到什么大问题,可是一旦 ...

  2. Redis系列-远程连接redis并给redis加锁

    假设两台redis服务器,ip分别为:192.168.1.101和192.168.1.103,如何在101上通过redis-cli访问103上的redis呢?在远程连接103之前,先讲下redis-c ...

  3. Redis系列-远程连接redis

    假设两台redis服务器,ip分别为:192.168.1.101和192.168.1.103,如何在101上通过redis-cli访问103上的redis呢?在远程连接103之前,先讲下redis-c ...

  4. CentOS下配置redis允许远程连接

    1. 目的 因为想要学习redis,因此在虚拟机中安装了redis,为了实现在物理机可以访问redis,弄了好久:因此记录下来,以免忘记. 2. 环境 虚拟机:CentOS Linux release ...

  5. [日常] CentOS安装最新版redis设置远程连接密码

    wget http://download.redis.io/releases/redis-4.0.8.tar.gztar -zxvf redis-4.0.8.tar.gzmake完成后就会放在了src ...

  6. redis开启远程连接访问和需要密码的方法

    redis默认是不能远程访问的,如果希望多台机子共用redis数据库,那就需要开启redis远程连接访问.既然可以远程连接了,那就需要密码登陆,否则不安全.下面是具体的方法,按照步骤一步一步来就OK了 ...

  7. 远程快速安装redis和远程连接

    一.安装redis    1.设置redis的仓库地址, 执行命令: yum install epel-release    出现下图即设置成功 2.安装redis 执行命令如下: yum insta ...

  8. Ubuntu18.04,安装Redis配置远程连接访问和简单使用Redis

    前言 Redis是常用基于内存的Key-Value数据库,比Memcache更先进,支持多种数据结构,高效,快速.用Redis可以很轻松解决高并发的数据访问问题:作为实时监控信号处理也非常不错. 环境 ...

  9. redis设置远程连接

    1.修改redis服务器的配置文件 本机安装的redis-4.0.14默认的配置文件 redis.conf 设置 绑定本机地址:bind 127.0.0.1 开启保护模式:protected-mode ...

随机推荐

  1. HDU 1131

    N个节点的不同的树的数目.这样 随便取一个节点作为根,那么他左边和右边的儿子节点个数就确定了,假定根节点标号为x,那么左子树的标号就从1到x-1,共x-1个,右子树的标号就从x+1到n,共n-x个,那 ...

  2. 华硕 X201E 拆机

    每次笔记本拆机,装好之后.就会发现多了几个螺丝,忘了从哪拧下来了 以下记录下华硕 X201E 清灰拆机过程 1:电脑正面图 2:背面图,一共9个螺丝 3:背面的9个螺丝拧下来,把后盖沿着缝隙扣下来 w ...

  3. 纯粹的K12精髓 - 名师指导整理《20以内加法口诀表》

    纯粹的K12精髓 - 名师指导整理<20以内加法口诀表> 太阳火神的漂亮人生 (http://blog.csdn.net/opengl_es) 本文遵循"署名-非商业用途-保持一 ...

  4. HBase基本数据操作具体解释

    引言 本文档參考最新(截止2014年7月16日)的官方Ref Guide.Developer API编写. 全部代码均基于"hbase 0.96.2-hadoop2"版本号编写.均 ...

  5. C++ Primer Plus的若干收获--(三)

    有时候怀疑真是怀疑自己走的路究竟是不是正确的.作为一个土生土长数学系学生,却对数学毫无兴趣,没事的时候就喜欢躲在图书馆看看有关计算机的书.有时候期末考试时候会挂个一两门的数学专业课,有时候真希望数学课 ...

  6. CentOS Linux 加硬盘,分区和设置自动挂载

    sda 表示第1块SCSI硬盘hda 表示第1块IDE硬盘(即连接在第1个IDE接口的Master口上)scd0 表示第1个USB光驱当添加了新硬盘后,在/dev目录下会有相应的设备文件产生.ccis ...

  7. Defining and using constants from PySide in QML

    Defining and using constants from PySide in QML This PySide tutorial shows you how to define constan ...

  8. IDEA模板设置

    /**   * @className: $CLASSNAME$   * @author: liuyachao   * @date: $DATE$ $TIME$ */ ================= ...

  9. C# 实现ADSL自动断网和拨号(适用于拨号用户)

    using System;using System.Runtime.InteropServices; public struct RASCONN{    public int dwSize;    p ...

  10. 关于lncRNA数据收集

    最近需要自己收集数据库里的核酸序列,于是直接面对一些神文 http://www.360doc.com/content/17/0120/08/30227855_623625901.shtml http: ...