升级版本

3.0.2 版本升级到 redis-3.2.0 版本远程无法访问,比较配置文件有些变化,比如默认只能本地的机器才能访问

3.0.2 版本
# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# 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

redis-3.2.0版本
# 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

# 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

安全
##Redis 配置
http://redis.io/download
http://redis.io/documentation
######编译包
yum update
yum -y install gcc gcc-c++ autoconf automake make
######下载编译

wget http://download.redis.io/releases/redis-3.2.0.tar.gz
tar xzf redis-3.2.0.tar.gz
cd redis-3.2.0
make

######编译测试
yum install tcl
make test
######注释bind
# bind 127.0.0.1
######守护进程启动
daemonize yes
#保护模式[无密码模式设置为no]
protected-mode no
#设置密码
requirepass test
######数据文件路径
dir /opt/data/
######日志文件路径
logfile "/opt/data/redis.log"
######缓存数据名称
dbfilename dump.rdb
#查看防火墙关闭状态
service iptables status
######关闭命令
service iptables stop
######永久关闭防火墙
chkconfig iptables off
######主从
配置一个从服务器非常简单,只要在配置文件中增加以下的这一行就可以了:
slaveof 192.168.210.31 6379
SLAVEOF 192.168.210.31 6379
######启动
src/redis-server /opt/redis-3.2.0/redis.conf
######测试
$ src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
######查看进程
ps -ef | grep redis
######杀死进程
kill -9 25946

监控

监控是使用的Opserver,启用了密码后,官方也没有相关配置的文档,调试了代码,强制设置了默认的密码。

REFER:
请务必注意 Redis 安全配置,否则将导致轻松被入侵
https://ruby-china.org/topics/28094
记一次Redis被攻击的事件
http://www.cnblogs.com/yangecnu/p/An-Production-Accidents-Caused-by-Redis-Attacked.html
Redis 未授权访问缺陷可轻易导致系统被黑
http://www.oschina.net/news/67975/redis-defect
Redis3.0与3.2文件对比
https://carlosfu.iteye.com/blog/2303254

关于 Redis 访问安全性的问题的更多相关文章

  1. redis访问安全加固

    目录 redis漏洞 入侵特征 安全隐患 redis安全规范 禁止root用户启动 限制redis文件目录访问权限 开启密码认证,设置复杂密码 禁用或重命名危险命令 设置允许监听地址,不要使用0.0. ...

  2. 使用kendynet构建异步redis访问服务

    使用kendynet构建异步redis访问服务 最近开始在kendynet上开发手游服务端,游戏类型是生存挑战类的,要存储的数据结构和类型都比较简单,于是选择了用redis做存储,数据类型使用stri ...

  3. Memcached存Session数据、访问安全性、使用场景总结(3)

    最近做了一个单点登录SSO,登陆后的凭证放到Memcached令牌放到Cookies:但是用户经常掉线,开发环境和测试却没有这个问题,最后从Memcached找到原因. Memcached概念.作用. ...

  4. hystrix完成对redis访问的资源隔离

    相对来说,考虑的比较完善的一套方案,分为事前,事中,事后三个层次去思考怎么来应对缓存雪崩的场景 1.事前解决方案 发生缓存雪崩之前,事情之前,怎么去避免redis彻底挂掉 redis本身的高可用性,复 ...

  5. nginx lua redis 访问频率限制(转)

    1. 需求分析 Nginx来处理访问控制的方法有多种,实现的效果也有多种,访问IP段,访问内容限制,访问频率限制等. 用Nginx+Lua+Redis来做访问限制主要是考虑到高并发环境下快速访问控制的 ...

  6. 优雅的处理Redis访问超时

    很长一段时间以来,一直在项目中使用Redis作为辅助存储,确切来说是利用Redis的内存存储,而不是将其作为缓存.比如常见的利用Set集合来判断某个数值是否存在,或者将来自不同请求的数据放在Redis ...

  7. Web API的接口访问安全性

    使用签名获取Token 首先我们自定义appkey.appSecret.可用GUID随机生成,AppSecret要不定期更换.然后放到配置文件中. Appkey=1AF62C68-B970-46E7- ...

  8. SpringBoot入门 (七) Redis访问操作

    本文记录学习在SpringBoot中使用Redis. 一 什么是Redis Redis 是一个速度非常快的非关系数据库(Non-Relational Database),它可以存储键(Key)与 多种 ...

  9. 5.C#编写Redis访问类

    那么通过前面几篇博文,服务端的安装和配置应该没什么问题了,接下来的问题是如何通过代码来访问Redis. 这里我们使用的库为: StackExchange.Redis GitHub:https://gi ...

随机推荐

  1. 最常用的PHP正则表达式收集整理

    最常用的PHP正则表达式收集整理 提交 我的评论 加载中 已评论 最常用的PHP正则表达式收集整理 2015-03-20 PHP100中文网 PHP100中文网 PHP100中文网 微信号 功能介绍 ...

  2. linux-8 基本命令---echo

    1.echo   命令用于终端显示字符或变量 格式:“echo[字符串| 变量]” @1 .echo命令的字符串输出到终端: @2 .echo查看当前SHELL的变量值(前面有$符号): @3 .查看 ...

  3. 20 个免费的 Bootstrap 的后台管理模板

    之前 OSC 曾经发过多个后台管理界面模板的推荐,例如: 50 个漂亮的后台管理界面模板 25 个精美的后台管理界面模板和布局 分享 6 套超酷的后台管理员界面网站模板 30个优秀的后台管理界面设计案 ...

  4. JqueryEasyUI浅谈本地化应用

    JqueryEasyUI浅谈本地化应用 Jquery是对javascript一种封装,使我们开发人员使用起来更加方便,同时也解决了不同浏览器中javascript的兼容性.JqueryEasyUi是基 ...

  5. js继承精益求精之寄生式组合继承

    一.混合/组合继承的不足 上一篇JS继承终于混合继承,认真思考一下,发现其还是有不足之处的: 空间上的冗余:在使用原型链的方法继承父类的原型属性(Animal.prototype)的同时,也在子类的原 ...

  6. Scala 中 构造函数,重载函数的执行顺序

    在调试scala在线开发教程(http://www.imobilebbs.com/wordpress/archives/4911)的过程中看到了以下代码,但是这段代码无论怎么调试都无法成功. abst ...

  7. Vue学习笔记1

    目录 前言 1.vue和avalon一样,都不支持VM初始时不存在的属性 2.input元素中属性与v-model同时存在以属性为优先 3.VM中的函数放到data属性和methods属性中的区别,以 ...

  8. atitit.dw不能显示正确的百分比高度in dw的解决

    atitit.dw不能显示正确的百分比高度in dw的解决 div 设置35%的高度,三,不能正确的显示高度...环境dw cs6 但是设置161px奏能ok了...表明这个是dw的一个bug... ...

  9. paip.检测信用卡账单数据的正确性算法

    paip.检测信用卡账单数据的正确性算法 主要3点: //1.重点检测.大钱记录 //2.检测遗漏记录 //3.排除双唇记录. //4.试着cls share,改变错误的cls. 作者Attilax ...

  10. 盘点mysql中容易被我们误会的地方

    引语:mysql作为数据库的一大主力军,到处存在于我们各种系统中,相信大家都不陌生!但是,你知道你能用不代表你知道细节,那我们就来盘点盘点其中一些我们平时不太注意的地方,一来为了有趣,二来为了不让自己 ...