文章图片
Linux --- Redis Install
-
- 1.Download
- 2.Install
- 3.Close
- 4.Openssl Create key/crt
- 5.Error
-
- 5.1 DENIDE Redis is running in protected
- 6.Key
- 7.GodFather
Document website: https://redis.io/docs/about/.
文章图片
文章图片
在一秒钟内看到本质的人和花半辈子也看不清一件事本质的人,自然是不一样的命运。1.Download Redis download website: https://download.redis.io/releases/.
文章图片
2.Install
- 要么直接在服务器上下载
wget https://download.redis.io/releases/redis-6.2.6.tar.gz- 要么本地下载上传
yum install -y lrzsz
rz
- 解压
tar -zxvf redis-6.2.6.tar.gz
文章图片
- 安装gcc
yum -y install gcc- 进入redis
cd redis-6.2.6- 编译
不加密
=> make
加密
=> make BUILD_TLS=yes
configure ssl: https://redis.io/docs/manual/security/encryption/.
文章图片
- 安装
sudo make install
文章图片
- 启动
不加密
=>redis-server
文章图片
不加密
=>redis-cli
文章图片
加密
=>cd src
文章图片
加密
=>redis-server执行下面命令
文章图片
文章图片
加密
=>再执行redis-cli命令
文章图片
加密
=>redis-cli也要加密
文章图片
redis-server --tls-port 6379 --port 0 \
--tls-cert-file /home/xxx/airflow/openssl/ca.crt \
--tls-key-file /home/xxx/airflow/openssl/ca.key \
--tls-ca-cert-file /home/xxx/airflow/openssl/ca.crtredis-cli --tls \
--cert /home/xxx/airflow/openssl/ca.crt \
--key /home/xxx/airflow/openssl/ca.key \
--cacert /home/xxxx/airflow/openssl/ca.crt
3.Close
4.Openssl Create key/crt 使用 OpenSSL 创建ssl证书: https://blog.csdn.net/weixin_43916074/article/details/125997752.
- 关闭服务,查询pid
ps -ef | grep redis
文章图片
netstat -npl- kill pid
kill -9 pid- 通过redis-cli命令关闭
redis-cli shutdown
【Linux|Linux --- Redis Install】 CA根证书的生成
5.Error 5.1 DENIDE Redis is running in protected
- Generate CA private key
openssl genrsa -out ca.key 2048
- Generate CSR
openssl req -new -key ca.key -out ca.csr
- Generate Self Signed certificate(CA 根证书)
openssl x509 -req -days 750 -in ca.csr -signkey ca.key -out ca.crt
DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the lookback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the --portected-mode no option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
6.Key
- 修改redis.conf
protected-mode no
# bind 127.0.0.1 -::1
- 启动指向配置文件(此处是两个点)
redis-server …/redis.conf
- 加密启动和上面一样
redis-server …/redis.conf 后面继续
7.GodFather
- 获取redis里面所有的keys
文章图片
我是个迷信的人,若是他不幸发生意外,或被警察开枪打死,或在牢里上吊,或是他被闪电击中,那我会怪罪这个房间里的每一个人,到那时候我就不会再客气了…
文章图片
推荐阅读
- 后端|一个忙碌架构师的Java后端书架(2022)
- 兔老大的系统设计|兔老大的系统设计(一)健康度系统
- 《Linux》|<Linux常用开发工具使用(yum、vim、gcc/g++、gdb、make/Makefile等)>——《Linux》
- 网络实战对抗——Linux系统|(渗透测试后期)Linux进程隐藏详解
- Linux|Linux进程编程实践1——进程的基本概念、fork创建进程
- Linux|超级详细的Linux抓包工具tcpdump详解!
- Linux|Linux抓包(wireshark+tcpdump)
- 运维笔记|Linux性能优化——使用 tcpdump 和 Wireshark 分析网络流量
- 网络|Linux网络抓包分析工具