如何实现https密钥对登录方式

先安装docker

yum install -y yum-utils device-mapper-persistent-data lvm2

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

systemctl start docker.service systemctl enable docker.service

yum install -y docker-ce docker-ce-cli containerd.io

vim /opt/harbor/harbor.yml

openssl genrsa -des3 -out server.key 2048

openssl genrsa :生成密钥 RSA

-des3:加密的算法 Triple DES加密的算法,生成的私钥进行加密

-out server.key 生成私钥文件

2048:密钥的位数是2048

openssl rsa -in server.key.old -out server.csr

cp server.key server.key.old

chmod 777 server.*

/prepare

./install.sh

第二台机器也需要docker

mkdir -p /etc/docker/certs.d/hub.test.com

docker pull nginx

回到第一台docker上

cd /

scp -r data/ root@20.0.0.62:/

再回到第二台docker上

docker pull nginx

cp server.crt server.csr server.key /etc/docker/certs.d/hub.test.com/

vim /lib/systemd/system/docker.service

systemctl daemon-reload

systemctl restart docker

yum -y install telnet

telnet hub.test.com 443

docker tag nginx:latest hub.test.com/library/nginx:wqb

docker login -u admin -p 123456 https://hub.test.com

docker push hub.test.com/library/nginx:wqb

相关推荐
moonless02221 天前
FastAPI框架,这一小篇就能搞懂精髓。
http·fastapi
FPGA_Linuxer2 天前
FPGA 40 DAC线缆和光模块带光纤实现40G UDP差异
网络协议·fpga开发·udp
real 12 天前
传输层协议UDP
网络·网络协议·udp
ftpeak2 天前
从零开始使用 axum-server 构建 HTTP/HTTPS 服务
网络·http·https·rust·web·web app
hsjkdhs2 天前
网络编程之UDP广播与粘包问题
网络·网络协议·udp
00后程序员张2 天前
详细解析苹果iOS应用上架到App Store的完整步骤与指南
android·ios·小程序·https·uni-app·iphone·webview
yzx9910132 天前
接口协议全解析:从HTTP到gRPC,如何选择适合你的通信方案?
网络·人工智能·网络协议·flask·pygame
板鸭〈小号〉3 天前
UDP-Server(3)chat聊天室
网络·网络协议·udp
weixin_456904273 天前
使用HTTPS 服务在浏览器端使用摄像头的方式解析
网络协议·http·https
不会叫的狼3 天前
HTTPS + 域名 + 双向证书认证(下)
https