1.禁止一些高危命令
修改 redis.conf 文件,添加
来禁用远程修改 DB 文件地址
2.以低权限运行 Redis 服务
为 Redis 服务创建单独的用户和家目录,并且配置禁止登陆
useradd -s /bash/false -M redis
3.为 Redis 添加密码验证
修改 redis.conf 文件,添加
4.禁止外网访问 Redis
修改 redis.conf 文件,添加或修改
使得 Redis 服务只在当前主机可用
启动命令: sudo -u redis /目录/redis-server /目录/redis.conf >/dev/null 2>&1 &
【阅读全文】