redis配置密码认证,通过密码可以进行连接
需求说明:
今天配置了一台redis服务器,想要也和其他的数据库一样配置用户名/密码的方式进行登录.
查找了一下,没看到配置用户名的地方,就是有认证密码,所以就做了测试,在此进行记录.
操作过程:
1.开启redis的密码认证,打开redis.conf,找到以下的内容
[aiprd@redhat6 redis-4.0.2]$ grep "requirepass" redis.conf
# If the master is password protected (using the "requirepass" configuration
# requirepass foobared
2.将requirepass前面的注释去掉,并且将foobard改成自己的密码
[aiprd@redhat6 redis-4.0.]$ grep "requirepass" redis.conf
# If the master is password protected (using the "requirepass" configuration
requirepass An4Z0EnM
备注:认证密码已经被修改.
3.重启redis server使得配置文件生效,而后登录到redis客户端,获取key信息
[aiprd@redhat6 redis-4.0.]$ src/redis-cli
127.0.0.1:> keys *
(error) NOAUTH Authentication required.
127.0.0.1:>
说明:如果进行密码认证是不能获取其中的数据的.注意,这里有一个重启redis server的过程.
4.通过在redis客户端中使用auth <password>的方式获取redis中的数据
[aiprd@redhat6 redis-4.0.]$ src/redis-cli
127.0.0.1:> keys *
(error) NOAUTH Authentication required.
127.0.0.1:> auth An4Z0EnM #在此输入auth加上密码之后,就能够获redis中的数据.
OK
127.0.0.1:> keys *
(empty list or set)
5.在命令行中,直接通过-a选项加上密码进行认证
[aiprd@redhat6 redis-4.0.]$ src/redis-cli -a An4Z0EnM
127.0.0.1:> keys *
(empty list or set)
127.0.0.1:>
小结:
在redis中没有用户的概念,就是一个认证的密码,认证成功后获取其中的数据.
文档创建时间:2018年4月16日20:37:29
redis配置密码认证,通过密码可以进行连接的更多相关文章
- redis配置用户认证密码
1,下载安装 Download, extract and compile Redis with: $ wget http://download.redis.io/releases/redis-3.2. ...
- Huawei华为交换机 consolep密码和vty密码配置telnet,ssh
以登录用户界面的认证方式为密码认证,密码为Huawei@123为例,配置如下. <HUAWEI> system-view [HUAWEI] user- [HUAWEI-ui-console ...
- redis配置认证密码
redis配置密码1.通过配置文件进行配置yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到 #requirepass foobared 去掉行前的注释,并修改 ...
- redis配置密码认证
redis配置密码 1.通过配置文件进行配置yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到 ? 1 #requirepass foobared 去掉行前的注 ...
- redis配置认证密码(转)
redis配置密码 1.通过配置文件进行配置yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到 ? 1 #requirepass foobared 去掉行前的注 ...
- 动态添加Redis密码认证
如果redis已在线上业务使用中,但没有添加密码认证,那么如何在不影响业务服务的前提下给redis添加密码认证,就是一个需要仔细考虑的问题. 本文描述一种可行的方案,适用于客户端使用了jedis连接池 ...
- redis配置密码 redis常用命令
redis配置密码 1.通过配置文件进行配置yum方式安装的redis配置文件通常在/etc/redis.conf中,打开配置文件找到 [plain] view plain copy #requi ...
- Redis 配置登录密码
1. 通过配置文件进行配置 打开 redis.conf,找到 #requirepass foobared 去掉行前的注释,并修改密码为所需的密码,保存文件 重启redis sudo service r ...
- 动态添加Redis密码认证的方法
1.定制jedis 对redis返回的错误的处理,做两处修改: 忽略 (error) ERR Client sent AUTH, but no password is set.使配置了密码的jedis ...
随机推荐
- ORACLE 新增记录 & 更新记录
开发中偶尔需要新增一条记录或修改一条记录的几个字段,语法中有微妙的区别. 由于不是经常写,久不写就忘记了,而又要重新查找或调试. 新增记录语法: --新增记录(仿照已有表记录)INSERT INTO ...
- Java IP地址字符串与BigInteger的转换, 支持IPv6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...
- uboot的lds文件分析
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") ...
- LeetCode: Spiral Matrix 解题报告
Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix ...
- Session过期后自动跳转到登录页面
最近研究如果用原生的Filter来判别session存在否或者过期否.来跳转到的页面实例,下载来展示代码. 因为顾虑器是每次请求能会进入的,所以可以设置了,进行拦截判断 1.配置web.xml < ...
- [转]C#读取Word指定页的内容
/// <summary> /// Word按页读取内容 /// </summary> /// <param name="page">页数< ...
- linux定时任务crontab设置
crontab是linux下的定时任务,类似于window下的计划任务: crontab -l ##查询任务列表 crontab -e ##编辑定时任务 首先准备好要执行的脚本monitor_fs.s ...
- C++实现八皇后问题
C++实现八皇后问题 #include <iostream> using std::cout; using std::endl; #include <iomanip> usin ...
- Linux系统分区方案建议
在安装Linux系统之初,就应该考虑怎样使linux系统得到最好的性能.linux本身也设计为可以良好扩展的形态. 笔者建议系统程序和业务程序分离安装比较合理,笔者所在的公司也是按照这种理念实施的.比 ...
- jquery-ajax-php(内容点赞并进行cookie限制实现)
1.模板页html例如以下: 2.模板页的jquery里的ajax实现例如以下: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T ...