Zavier's Blog

使用openssl为服务器配置自签名SSL证书

SSH登录服务器后

首先创建存放证书的文件夹

mkdir /etc/https

安装openssl

CentOS:

yum install -y openssl openssl-devel

或者 Ubuntu: 

apt-get install openssl openssl-devel

openssl genrsa -des3 -out server.key 2048      //生成2048位RSA私钥

openssl req -new -key server.key -out server.csr //生成csr证书申请文件

openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt //生成自签名证书

openssl rsa -in server.key -out server.key.nopass //将带密码的私钥转化为不带密码私钥

 

Country Name (2 letter code) []:             //国家名

State or Province Name (full name) []:        //州/省名字

Locality Name (eg, city) []:            //地/市名

Organization Name (eg, company) []:           //组织/公司名字

Organizational Unit Name (eg, section) []:      //单位名

Common Name (eg, your name or your server's hostname) []:         //服务器名或个人名

Email Address []:          //邮箱地址可不填

Please enter the following 'extra' attributes to be sent with your certificate request

A challenge password []:            //可不填

An optional company name []:         //可不填


  • 评论列表:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Copyright © 2017-2023 Zavier的博客.网站地图