Redis服务器创建密码

2016-12-15 17:32:00
村里来的扫地僧
原创
963
如何为Redis服务器设置密码
修改redis.conf文件480行:
	 476 # Warning: since Redis is pretty fast an outside user can try up to
	 477 # 150k passwords per second against a good box. This means that you should
	 478 # use a very strong password otherwise it will be very easy to break.
	 479 #
	 480 # requirepass foobared
	 481 
修改如下:
	 476 # Warning: since Redis is pretty fast an outside user can try up to
	 477 # 150k passwords per second against a good box. This means that you should
	 478 # use a very strong password otherwise it will be very easy to break.
	 479 #
	 480  requirepass password123@

关闭Redis服务:
	[root@linux-02 bin]# redis-cli shutdown

重启Redis服务:
	[root@linux-02 bin]# ./redis-server /redis/redis.conf 

查看是否生效:
	[root@linux-02 bin]# redis-cli 
	127.0.0.1:6379> SET KEY3 KEY3
	(error) NOAUTH Authentication required. 提示权限不够
	127.0.0.1:6379> 

Redis认证:
	127.0.0.1:6379> AUTH password123@       
	OK
	127.0.0.1:6379> 
	
创建并检查:
	127.0.0.1:6379> SET KEY3 KEY3
	OK
	127.0.0.1:6379> get KEY3
	"KEY3"
	127.0.0.1:6379> 

	
发表评论
陆 减 玖 =
评论通过审核后显示。