Elasticsearch 监控3

2022-02-10 20:24:52 浏览数 (1)

创建自签名证书

代码语言:javascript复制
[root@es_node tengine-2.1.2]# cd /usr/local/nginx/
[root@es_node nginx]# ls
conf  html  include  logs  modules  sbin
[root@es_node nginx]# mkdir cert
[root@es_node nginx]# cd cert/
[root@es_node cert]# openssl genrsa -out es.key 2048
Generating RSA private key, 2048 bit long modulus
...................   
...........   
e is 65537 (0x10001)
[root@es_node cert]# openssl req -new -key es.key -out es.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) []:Shanghai
Locality Name (eg, city) [Default City]:Shanghai
Organization Name (eg, company) [Default Company Ltd]:es
Organizational Unit Name (eg, section) []:es
Common Name (eg, your name or your server's hostname) []:es
Email Address []:ok@es.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[root@es_node cert]# openssl x509 -req -days 365 -in es.csr -signkey es.key -out es.crt
Signature ok
subject=/C=CN/ST=Shanghai/L=Shanghai/O=es/OU=es/CN=es/emailAddress=ok@es.com
Getting Private key
[root@es_node cert]# ll
total 12
-rw-r--r-- 1 root root 1249 Jan  6 19:54 es.crt
-rw-r--r-- 1 root root 1025 Jan  6 19:53 es.csr
-rw-r--r-- 1 root root 1675 Jan  6 19:49 es.key
[root@es_node cert]# chmod 600 *
[root@es_node cert]# ll 
total 12
-rw------- 1 root root 1249 Jan  6 19:54 es.crt
-rw------- 1 root root 1025 Jan  6 19:53 es.csr
-rw------- 1 root root 1675 Jan  6 19:49 es.key
[root@es_node cert]#

0 人点赞