旋风 redis 客户端有一个auth
方法,您可以发送密码到,已将密码设置在redis.conf
def auth(self, password):
"""
Simple password authentication if enabled
"""
return self.execute_command("AUTH", password)
但是在使用 redis auth 之前要非常小心。它并不是真正被认为是安全的(按设计),并且应该主要用于保护实例免受导致客户端连接到错误数据库的配置错误,而不是作为一种安全方法。
来自 redis 配置文档:
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.