[root@localhost cert]# openssl genrsa -des3 -out server.key 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...................................+++++
..............+++++
e is 65537 (0x010001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
#提示输入私钥密码,两次输入一致即可
[root@localhost cert]# ll
总用量 4
-rw------- 1 root root 1751 9月 10 22:26 server.key
2、生成证书请求
[root@localhost cert]# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key: #输入上面的私钥密码
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) [AU]:CN #国家名
State or Province Name (full name) [Some-State]:JS #省名
Locality Name (eg, city) []:NJ #城市名
Organization Name (eg, company) [Internet Widgits Pty Ltd]:test #组织名
Organizational Unit Name (eg, section) []:test #机构名
Common Name (e.g. server FQDN or YOUR name) []:www.test.com #域名
Email Address []:1255109811@qq.com #邮箱名
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: #是否需要改变密码(不需要直接enter)
An optional company name []: #公司名称(不需要直接enter)
[root@localhost cert]# ll
总用量 8
-rw-r--r-- 1 root root 1033 9月 10 22:36 server.csr
-rw------- 1 root root 1751 9月 10 22:26 server.key