栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 软件开发 > 后端开发 > Java

Failed opening the RDB file admin (in server root dir /etc/cron.d) Background saving error

Java 更新时间:发布时间: 百科书网 趣学号

问题描述:

刚在腾讯云装上redis没多久就收到有攻击行为。担心被当做肉鸡了,于是立马把服务器关了,立马改了远程登录密码

用last查看服务器有没有被人登录了,就我一个用xshell远程登录,问题不在这

查看redis的日志:

* 10 changes in 300 seconds. Saving...
* Background saving started by pid 3751
# Failed opening the RDB file admin (in server root dir /etc/cron.d) for saving: 
Permission denied
#Background saving error
问题分析:

怎么redis会去访问/etc/cron.d,它下面是存放的是定时任务脚本,除非我自己写定时任务也不通过redis。

那应该可能是攻击者想通过redis去写一些定时任务进去。redis被利用了。

 解决方法:

给redis加安全策略:

由于我的redis是部署在docker中的,因此需要通过docker exec进入,再通过

config set requirepass 密码的形式修改

docker exec -it redis /bin/bash
redis-cli
config set requirepass 你的密码

提一句是:密码最好长点,因为redis太快了,密码长度不够,很容易被暴力破解。

再进入配置文件:修改bind为你的外网ip,protected-mode 设置为yes,启动保护模式

docker 容器里的具体做法是:

vi /etc/redis/redis.conf
bind #你的外网ip
protected-mode yes

重启redis

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/273601.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号