Up in the Air!
在云端
Home
Categories
Archives
Tags
About
Home
用Openssl生成10年有效期的自签名证书
用Openssl生成10年有效期的自签名证书
取消
用Openssl生成10年有效期的自签名证书
由
aoeII
发布于 2017-01-18
·
最后更新:2018-01-18
2883
本文介绍在Centos 6和7上如何使用 Openssl 生成10年有效期的自签名证书 欢迎转载,转载请注明出处:https://aoeii.com/posts/how_to_use_openssl_to_creat_10-year-selfsigned-certs_on_centos_6_and_7 ---------- # 创建保存证书的目录 [root@www ~]# mkdir certs [root@www ~]# cd certs # 创建私钥 [root@www certs]# openssl genrsa -out server.key 2048 > Generating RSA private key, 2048 bit long modulus > ...................+++ > .......................................................................+++ > e is 65537 (0x10001) # 通过命令行交互方式创建证书申请文件 [root@www certs]# openssl req -new -key server.key -out server.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) []:HONG KONG > Locality Name (eg, city) [Default City]:HONG KONG > Organization Name (eg, company) [Default Company Ltd]:aoeii.com > Organizational Unit Name (eg, section) []:aoeii.com > Common Name (eg, your name or your server's hostname) []:aoeii.com > Email Address []:master@aoeii.com > > Please enter the following 'extra' attributes > to be sent with your certificate request > A challenge password []: > An optional company name []: # 用私钥签名证书申请文件,创建有效时间为10年的自签名证书 [root@www certs]# openssl x509 -req -in server.csr -out server.crt -signkey server.key -days 3650 > Signature ok > subject=/C=CN/ST=HONG KONG/L=HONG KONG/O=aoeii.com/OU=aoeii.com/CN=aoeii.com/emailAddress=master@aoeii.com > Getting Private key # 或者使用命令行跳过证书申请文件,一步创建证书 [root@www certs]# openssl req -new -x509 -days 3650 -key server.key -out server.crt -subj "/C=CN/ST=HONG KONG/L=HONG KONG/O=aoeii.com/OU=aoeii.com/CN=aoeii.com/emailAddress=master@aoeii.com"
blog
linux
certification
openssl
centos
linux
该博客文章由作者通过
CC BY 4.0
进行授权。
分享
最近更新
ESXi 6.7 离线升级 7.0U3
N5105 软路由安装 ESXi 7 直通核显给 Debian / Ubuntu 虚拟机通过 Docker 实现 jellyfin 硬件转码视频文件(硬解/编码)
Leanote 支持 emoji、chart.js 以及 mermaid
手把手教你自建开源免费私有云盘服务nextcloud 14
在Centos 6和7上安装设置MySQL / MariaDB 5.5或以上的版本
热门标签
linux
centos
python
ESXi
windows
leanote
mysql
font
Docker
phpmyadmin
文章目录
CentOS 6 x86_64 安装Python2.7.15
手把手教你自建开源免费云笔记蚂蚁笔记leanote服务器,完全攻略教程比官方更详细