AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 743019
Accepted
Nathan Basanese
Nathan Basanese
Asked: 2015-12-15 14:17:34 +0800 CST2015-12-15 14:17:34 +0800 CST 2015-12-15 14:17:34 +0800 CST

我可以更改 Redis 集群中正在运行的 Redis 实例的 MASTERAUTH 值吗?

  • 772

根据http://redis.io/topics/security,我可以在 Redis 配置文件中设置一个requirepass值,例如, 。requirepass foobared

但是,我不希望在我的配置文件中使用它。

基本上,我想将此密码保留在.conf文件之外,并使用redis-cli.

################################## SECURITY ###################################

# 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.
#
# 2015.12.14 nbasanes: Although I prefer enabling this, I'm not 
# sure it buys us much, since a clear password in a config 
# file is bad for security:
# requirepass foobared

# 2015.12.14  nbasanes: This could be interesting, although 
#   I don't put much weight in security-by-obscurity:
# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possible to completely kill a command by renaming it into
# an empty string:
#
# rename-command CONFIG ""
#
# Please note that changing the name of commands that are logged into the
# AOF file or transmitted to slaves may cause problems.
security
  • 2 2 个回答
  • 1905 Views

2 个回答

  • Voted
  1. SO User
    2019-05-23T19:59:15+08:002019-05-23T19:59:15+08:00

    是的,可以在运行时更改身份验证。(请参阅 Nathan Basanese 的回答)。

    此外,请确保触发 config rewrite 命令以保持身份验证。如果 Redis 实例重新启动,它可能会丢失

    CONFIG REWRITE
    

    您可以通过对您的 Redis 实例运行 CONFIG GET * 来获取可以在运行时更改的所有参数的列表

      127.0.0.1:6379> CONFIG GET *
      1) "dbfilename"
      2) "dump.rdb"
      3) "requirepass"
      4) ""
      5) "masterauth"
      6) ""
      7) "unixsocket"
      8) ""
    
    • 2
  2. Best Answer
    Nathan Basanese
    2015-12-15T14:24:23+08:002015-12-15T14:24:23+08:00

    是的,您确实可以requirepass在实时 Redis 实例上设置该值。

    此示例显示我在 Redis 从站上设置它:

    [nbasanes@SLAVEONE ~]$ redis-cli -h $(facter ipaddress)
    101.222.222.222:6379> CONFIG SET REQUIREPASS FOOBARED
    OK
    101.222.222.222:6379> CONFIG SET REQUIREPA FOOBARED
    (error) NOAUTH Authentication required.
    101.222.222.222:6379> AUTH FOOBARED
    OK
    101.222.222.222:6379> CONFIG SET REQUIREPA FOOBARED
    (error) ERR Unsupported CONFIG parameter: REQUIREPA
    10.252.226.179:6379> ROLE
    1) "slave"
    2) "101.102.94.22"
    3) (integer) 6379
    4) "connected"
    5) (integer) 702567
    101.222.222.222:6379>
    
    • 1

相关问题

  • OpenSSH 漏洞 [重复]

  • 选择什么安全套件?

  • 安全地授予对 SQL 2005 复制监视器的访问权限以创建快照

  • SSH 服务器零日漏洞利用 - 保护自己的建议

  • 如何将安全组添加到正在运行的 EC2 实例?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve