准备存放证书目录
mkdir -p /opt/ssl
生成私钥
localhost[qq]:~
Generating RSA private key, 1024 bit long modulus
...........++++++
.++++++
e is 65537 (0x10001)
localhost[qq]:~
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) []:BJ
Locality Name (eg, city) [Default City]:BJ
Organization Name (eg, company) [Default Company Ltd]:YONG
Organizational Unit Name (eg, section) []:cloud
Common Name (eg, your name or your server's hostname) []:10.10.10.10 ### 服务器名字
Email Address []: ### 邮箱可选
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: ### 密码为空
An optional company name []: ###密码为空
使用密钥文件生成证书-申请证书
localhost[qq]:~
server.csr
server.key
localhost[qq]:~
注释:
-x509:证书格式,固定的
days:证书的有效期
keys:指定密钥文件
in:指定证书申请文件
查看证书文件
localhost[qq]:~
total 12
-rw-r--r-- 1 root root 936 Apr 12 17:33 server.crt
-rw-r--r-- 1 root root 635 Apr 12 17:25 server.csr
-rw-r--r-- 1 root root 887 Apr 12 17:19 server.key
请书
-rw-r--r-- 1 root root 887 Apr 12 17:19 server.key
|