对于一些 redis 的高危命令,建议做禁用处理。
vim /opt/redis/conf/redis.conf #通过修改redis配置文件实现
#rename-command CONFIG "" rename-command KEYS "" rename-command FLUSHALL "" rename-command FLUSHDB "" rename-command CONFIG ""
#rename-command CONFIG "" rename-command KEYS "REDISKEYS" rename-command FLUSHALL "REDISFLUSHALL" rename-command FLUSHDB "REDISFLUSHDB" rename-command CONFIG "REDISCONFIG"
修改完成后重启Redis生效!