如何开启密码认证

找到 " # requirepass foobared ",去掉# ,将"foobared " 改成你需要设置的认证密码

然后重启redis服务 systemctl restart redis