Redis NOAUTH 错误 - 尽管在我的 redis.conf 文件中禁用了身份验证

Ale*_*lls 1 redis node.js

针对本地 Redis 实例在本地运行应用程序时,我看到以下错误。

ReplyError: Ready check failed: NOAUTH Authentication required.
            at JavascriptReplyParser.Parser.returnError (/Users/Olegzandr/WebstormProjects/node_redis/index.js:193:31)
            at JavascriptReplyParser.run (/Users/Olegzandr/WebstormProjects/node_redis/node_modules/redis-parser/lib/javascript.js:135:18)
            at JavascriptReplyParser.execute (/Users/Olegzandr/WebstormProjects/node_redis/node_modules/redis-parser/lib/javascript.js:112:10)
            at Socket.<anonymous> (/Users/Olegzandr/WebstormProjects/node_redis/index.js:269:27)
            at emitOne (events.js:77:13)
            at Socket.emit (events.js:169:7)
            at readableAddChunk (_stream_readable.js:146:16)
Run Code Online (Sandbox Code Playgroud)

我相信我已经通过在配置文件中使用这些行禁用了身份验证:

# By default protected mode is enabled. You should disable it only if
# you are sure you want clients from other hosts to connect to Redis
# even if no authentication is configured, nor a specific set of interfaces
# are explicitly listed using the "bind" directive.
protected-mode no  #is this correct?
Run Code Online (Sandbox Code Playgroud)

并且不需要密码:

# Require clients to issue AUTH <PASSWORD> before processing any other
# commands.  This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# 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.
#
# requirepass foobared
Run Code Online (Sandbox Code Playgroud)

知道可能出什么问题吗?

jlv*_*ero 6

如果有人CONFIG SET REQUIREPASS [PWD]在正在运行的 redis 实例中运行,那么 redis 将更改其身份验证配置,尽管有conf文件。之后,即使已经连接的客户端也必须设置 AUTH,否则他们将收到NOAUTH Authentication required.

尝试重新启动redis并小心有害的lamers!


Pat*_*Pat 5

在 redis-cli 上,使用正确的密码进行 AUTH(如果您错误地设置了密码)。然后将 requirepass 设置为空。这将解决该问题。

AUTH <old-password>
CONFIG SET REQUIREPASS ""
Run Code Online (Sandbox Code Playgroud)

注意:这仅在您知道密码时才有效(意味着您已为任何 Redis 实例设置了密码)。如果没有的话,上面的重启redis的解决方案就可以了。