本文内容为 http://www.redis.io/commands/auth 的翻译、注解、例子扩充及其它修改。感谢 Redis 作者 Antirez 为开源社区作出的贡献,本文保证最新、最准、最全以表示对其的敬意。欢迎留言纠错、提示更新或支持。
AUTH password

用于向受密码保护的(Password-protected)Redis 服务器请求认证(Authentication)

Request for authentication in a password-protected Redis server.

Redis 可以被设定为在允许客户端(Cliend)执行命令前需要一个密码。可以通过在配置文件中使用 requirepass 指令来完成改设定。

Redis can be instructed to require a password before allowing clients to execute commands. This is done using the requirepass directive in the configuration file.

如果参数 password 匹配保存在配置文件中的密码,服务器将会响应 OK 状态码,然后开始接收命令。否则,将会返回一个错误,而这个时候,客户端需要再次输入一个新的密码。

If password matches the password in the configuration file, the server replies with the OK status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password.

注意 因为 Redis 专注于高性能,使得其可以在一个极端的时间内并发尝试大量密码,所以,确保生成一个非常强壮(Strong)且足够长的密码,以使此类攻击基本无效。

Note: because of the high performance nature of Redis, it is possible to try a lot of passwords in parallel in very short time, so make sure to generate a strong and very long password so that this attack is infeasible.