【问题标题】:Redis AUTH with random password使用随机密码的 Redis AUTH
【发布时间】:2016-07-24 05:35:32
【问题描述】:

我有 2 台运行 redis 的服务器,一台在 VM 中开箱即用地交付给我,一台带有 redis 2.2.12 的旧 Ubuntu (12.04),我用 redis 2.8.19 自己配置的新服务器,一个 centos 7.我有一个带有redis的django应用程序在centos服务器中失败Client sent AUTH, but no password is set,如果我去redis-cli,我使用AUTH <anything>它会以同样的错误响应我,这没关系,但是,在如果我用任何随机密码做同样的事情,ubuntu 服务器会显示OK。这怎么可能?

这两个服务器都没有在 redis.conf 文件中配置身份验证。

【问题讨论】:

    标签: django ubuntu redis centos


    【解决方案1】:

    来自 redis.conf:

    # 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
    

    所以,除非你设置了requirepass,否则redis会接受任何没有认证的命令。

    【讨论】:

    • 我知道。但是两台服务器在 requirepass 方面具有相同的配置(也就是说,它都没有处于活动状态),并且 Ubuntu 仍然允许我使用 AUTH randompassword 命令并获得 OK 响应,而 CentOS 在尝试执行相同操作时给我一个错误。
    • 是的,我做到了。我什至重新启动系统。停止服务器,更改配置(添加密码)等
    • 接下来要检查的是正确的配置文件,我用的是ubuntu,配置在/etc/redis/6379.conf,我想这取决于你是如何安装的。
    • 很遗憾,我在 ubuntu 服务器上找不到另一个配置文件:/
    • 运行 redis-cli 并执行:config GET requirepass;
    猜你喜欢
    • 1970-01-01
    • 2015-10-16
    • 2011-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-30
    • 2012-08-07
    • 2014-12-27
    相关资源
    最近更新 更多