Redis禁用部分危險命令(keys/flushdb等)

在redis.conf文件【SECURITY】區域配置:html

一、禁用命令:redis

rename-command KEYS ""
rename-command FLUSHALL ""
rename-command FLUSHDB ""
rename-command CONFIG ""

二、重命名命令:spa

rename-command KEYS "xxxxxxxxxxxx"
rename-command FLUSHALL "yyyyyyyyyyyyy"
rename-command FLUSHDB "qqqqqqqqqqqqq"
rename-command CONFIG "aaaaaaaaaaaaaa"

 

若是須要使用【keys *】功能,可使用【scan/sscan/zscan/hscan】命令。code

具體用法參考官網:https://redis.io/commands/scanhtm

中文文檔:http://redisdoc.com/database/scan.html?highlight=scanblog

相關文章
相關標籤/搜索