网络技能大赛-云平台部分-CentOS部分07-[CA(https)]

2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国产操作系统。
再怎么变比赛的东西也就那么多,希望大家都能勇于动手尝试,多多摸索,愿大家都能取得一个理想的成绩!
交流共享资料群号:926132419

CA

http/nginx隐藏配置 OpenSSL搭建私有CA

#准备两台机器 一台CA服务器 一台客户Web服务器
#以下ServerB为CA服务器 ServerA为Web服务器
####在B上搭建CA服务器 注意路径
[root@serverB CA]# pwd
/etc/pki/CA
[root@serverB CA]# (umask 077;openssl genrsa -out pirvate/cakey.pem 4096)
pirvate/cakey.pem: No such file or directory
139921458653088:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('pirvate/cakey.pem','w')
139921458653088:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
[root@serverB CA]# ls
certs  crl  newcerts  private
[root@serverB CA]# cd private/
[root@serverB private]# ls
[root@serverB private]# (umask 077;openssl genrsa -out cakey.pem 4096)
Generating RSA private key, 4096 bit long modulus
....................................................................................................................++
..................................................................................................................................................................................................................................................................................................++
e is 65537 (0x10001)
[root@serverB private]# openssl req -new -x509 -key cakey.pem -out /etc/pki/CA/cacert.pem -days 3650
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:JS
Locality Name (eg, city) [Default City]:LYG
Organization Name (eg, company) [Default Company Ltd]:ZD
Organizational Unit Name (eg, section) []:BS
Common Name (eg, your name or your server's hostname) []:www.rj.com
Email Address []:
[root@serverB private]# ls
cakey.pem
[root@serverB private]# cd ..
[root@serverB CA]# ls
cacert.pem  certs  crl  newcerts  private
[root@serverB CA]# touch /etc/pki/CA/index.txt
[root@serverB CA]# echo 01 > serial
####在A上生成请求文件传到B上认证
[root@serverA nginx]# mkdir ssl
[root@serverA nginx]# cd ssl/
[root@serverA ssl]# ls
[root@serverA ssl]# (umask 066;openssl genrsa -out nginx.key 1024)
Generating RSA private key, 1024 bit long modulus
.........++++++
.........................++++++
e is 65537 (0x10001)
[root@serverA ssl]# openssl req -new -key nginx.key -out nginx.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:JS
Locality Name (eg, city) [Default City]:LYG
Organization Name (eg, company) [Default Company Ltd]:ZD
Organizational Unit Name (eg, section) []:BS
Common Name (eg, your name or your server's hostname) []:www.rj.com
Email Address []:Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@serverA ssl]# ls
nginx.csr  nginx.key
[root@serverA ssl]# scp ./nginx.csr root@172.16.0.139:/data
The authenticity of host '172.16.0.139 (172.16.0.139)' can't be established.
ECDSA key fingerprint is fb:dd:a8:d5:fc:21:c6:8e:99:c6:5d:89:0b:6e:a5:92.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.0.139' (ECDSA) to the list of known hosts.
root@172.16.0.139's password:
nginx.csr                             100%  627     0.6KB/s   00:00
[root@serverA ssl]#
####认证从A上传过来的请求文件 生成证书
[root@serverB CA]# openssl ca -in /data/nginx.csr -out /etc/pki/CA/certs/nginx.crt -days 365
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:Serial Number: 1 (0x1)ValidityNot Before: Sep 15 00:50:40 2020 GMTNot After : Sep 15 00:50:40 2021 GMTSubject:countryName               = CNstateOrProvinceName       = JSorganizationName          = ZDorganizationalUnitName    = BScommonName                = www.rj.comX509v3 extensions:X509v3 Basic Constraints: CA:FALSENetscape Comment: OpenSSL Generated CertificateX509v3 Subject Key Identifier: CC:71:62:76:0A:B3:DC:0E:8F:8A:61:71:67:56:FF:BA:53:E8:2C:6CX509v3 Authority Key Identifier: keyid:2D:A1:8E:3E:EB:1A:36:6D:B0:56:4C:15:55:2C:0A:85:DF:CA:B9:5ACertificate is to be certified until Sep 15 00:50:40 2021 GMT (365 days)
Sign the certificate? [y/n]:y1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
[root@serverB CA]# ls
cacert.pem  crl        index.txt.attr  newcerts  serial
certs       index.txt  index.txt.old   private   serial.old
[root@serverB CA]# cat index.txt
V       210915005040Z           01      unknown /C=CN/ST=JS/O=ZD/OU=BS/CN=www.rj.com
[root@serverB CA]# pwd
/etc/pki/CA
####从B往A传证书
[root@serverB CA]# cd certs/
[root@serverB certs]# ls
nginx.crt
[root@serverB certs]# scp ./nginx.crt root@172.16.0.138:/etc/nginx/ssl
The authenticity of host '172.16.0.138 (172.16.0.138)' can't be established.
ECDSA key fingerprint is fb:dd:a8:d5:fc:21:c6:8e:99:c6:5d:89:0b:6e:a5:92.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.0.138' (ECDSA) to the list of known hosts.
root@172.16.0.138's password:
nginx.crt                                                      100% 4888     4.8KB/s   00:00
[root@serverB certs]#
####查看证书是否传过来
[root@serverA ssl]# ls
nginx.crt  nginx.csr  nginx.key
[root@serverA ssl]# pwd
/etc/nginx/ssl

网络技能大赛-云平台部分-CentOS部分07-[CA(https)]相关推荐

  1. 网络技能大赛-云平台部分-CentOS部分13-[软件定义网络(详细)]

    网络技能大赛-云平台部分-CentOS部分13-[软件定义网络(详细)] 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS, ...

  2. 锐捷网络技能大赛-云平台部分-CentOS部分12-[Mariadb进阶-主从]

    锐捷网络技能大赛-云平台部分-CentOS部分12-[Mariadb进阶-主从] 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了Cen ...

  3. 网络技能大赛云平台部分-JCOS创建用户

    网络技能大赛云平台部分-JCOS创建用户 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国产操作系统 ...

  4. 2019网络技能大赛OpenDayLight-软件定义网络样题题目及答案

    2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国产操作系统. 再怎么变比赛的东西也就那么多,希望大家 ...

  5. 网络技能大赛做云平台部分-赛前注意事项[非常重要]

    网络技能大赛做云平台部分-赛前注意事项[非常重要] 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国 ...

  6. 网络技能大赛-高职组计算机网络应用竞赛竞赛-服务器JCOS部署02(一根网线不连接交换机)[附:过期后操作]

    2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国产操作系统. 再怎么变比赛的东西也就那么多,希望大家 ...

  7. 网络技能大赛-2018年国赛真题[2018年全国职业技能大赛高职组计算机网络应用赛项真题-I卷]路由交换部分答案详解

    网络技能大赛-2018年国赛路由交换部分答案详解 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS国产 ...

  8. 网络技能大赛-2019年国赛真题[2019年全国职业技能大赛高职组计算机网络应用赛项真题-H卷]路由交换部分答案详解

    网络技能大赛-2019年国赛真题[2019年全国职业技能大赛高职组计算机网络应用赛项真题-H卷]路由交换部分答案详解 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部 ...

  9. 网络技能大赛做路由交换部分-赛前注意事项[非常重要]

    网络技能大赛做路由交换部分-赛前注意事项[非常重要] 2022年全国职业技能大赛网络系统管理赛项相较2021年再次做出改动,Linux部分从之前的Debian又换回了CentOS,不过相应增加了UOS ...

最新文章

  1. ply补全为立方体_ply 点云文件格式
  2. 前端验证码后端返回一个图片_Web后端开发(6)——简易图片验证码的制作
  3. android tv如何适配不同的平台
  4. mysql双重分组没有值也要显示_mysql 统计数据,按照日期分组,把没有数据的日期也展示出来...
  5. c语言指针官方解释_C语言中的指针解释了–它们并不像您想象的那么难
  6. 机器学习实战8-sklearn降维(PCA/LLE)
  7. 探索专有领域的端到端ASR解决之道
  8. 又反转了!IEEE发布最新声明:解除对华为系成员的限制
  9. 11.29晚 心情 晴 既然选择了Linux这条路就要坚持走下去
  10. 好用的jquery选择器
  11. MSCRM 报表显示 rsprocessingaborted 错误
  12. python列表使用技巧大全_Python 基础起步 (六) List的实用技巧大全
  13. 数字信号处理——频域采样定理matlab验证
  14. 【企业架构】什么是 Zachman 框架? 用于管理企业架构的矩阵
  15. 【实战】1213- 点赞动画还可以做得那么飘逸!
  16. 网页中留言板的制作案例
  17. 在Ubuntu18.04中使用gazebo配合LOAM算法仿真
  18. 一个有用的Win32消息处理宏HANDLE_MSG
  19. Java--->Ajax(上)
  20. 区块链基础与网络安全

热门文章

  1. 解读羽毛球滑板推球技术要领
  2. Win10 + Ubuntu 18.04 双系统工作环境配置
  3. 以太天使(ETA)通过区块链打造全球领先的基因健康及精准医疗服务平台
  4. D3.js -- 图片制作
  5. MTK audio tuning tool
  6. 天地伟业客户端服务器维护,天地伟业监控官网客户端app
  7. 程序员保密协议书(与合作单位签署)
  8. html怎样回车,html回车
  9. IDEA调试出现帧不可用
  10. 吉洪诺夫 matlab,使用三种方法求解吉洪诺夫正则化参数,为什么结果相同