s1.一键证书申请和颁发脚本

s1.一键证书申请和颁发脚本,第1张

s1.一键证书申请和颁发脚本 一键证书申请和颁发脚本
[root@rocky8 ~]# cat certificate.sh
#!/bin/bash
#
#**********************************************************************************************
#Author:        Raymond
#QQ:            88563128
#Date:          2021-11-16
#FileName:      certificate.sh
#URL:           raymond.blog.csdn.net
#Description:   The test script
#Copyright (C): 2021 All rights reserved
#*********************************************************************************************
CA_SUBJECT="/O=raymonds/CN=ca.raymonds.cc"
CA_EXPIRE=3650
SUBJECT="/C=CN/ST=Shaanxi/L=xi'an/O=raymonds/CN=*.raymonds.cc"
SERIAL=01
EXPIRE=365
FILE=httpd

openssl req  -x509 -newkey rsa:2048 -subj ${CA_SUBJECT} -keyout ca.key -nodes -days ${CA_EXPIRE} -out ca.crt

openssl req -newkey rsa:2048 -nodes -keyout ${FILE}.key  -subj ${SUBJECT} -out ${FILE}.csr

openssl x509 -req -in ${FILE}.csr  -CA ca.crt -CAkey ca.key -set_serial ${SERIAL}  -days ${EXPIRE} -out ${FILE}.crt

chmod 600 ${FILE}.key ca.key

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5618715.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存