Redis 安全性设置

本文介绍如何为Redis设置密码以提高安全性。通过修改redis.windows.conf文件中的requirepass指令,并重启服务来生效。文中还介绍了客户端授权的两种方式。

redis安装好后,默认情况下登陆客户端和使用命令操作时不需要密码的。某些情况下,为了安全起见,我们可以设置在客户端连接后进行任何操作之前都要进行密码验证。

我这边是安装的window系统,修改redis.windows.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 hongda$123456

设置requirepass就可以

接下来要重启Redis服务

客户端授权方式

(1)登录时使用-a参数指定客户端密码,如下

(2)登录客户端后使用auth命令进行授权,如下

 

http://www.cnblogs.com/hjwublog/p/5660578.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值