zoukankan      html  css  js  c++  java
  • linux服务器上生成CSR和KEY


    CSR表示“ 证书签名请求 ”,这个该证书将用于服务器上。一个CSR包含有关您的组织和域名,地方和国家,将包含在证书中的公钥信息。 本文有3个简单的步骤来创建CSR上的Linux系统(证书签名请求)。您可以选择以下之一。

    CSR文件用来申请证书(提供给证书供应商)

    KEY文件是私钥,用来配置ssl(放到服务器)

    CERT是证书供应商颁发的证书(放到服务器)

    1.先创建个文件夹,然后进入这个文件夹执行命令:

      mkdir  ssl

      cd ssl

    2.执行命令:

      openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out server.csr

        执行完会出现一些要输入的信息:

      

    Country Name (2 letter code) [AU]: CN  (国家代码)
    State or Province Name (full name) [Some-State]: BJ  (省)
    Locality Name (eg, city) []: BJ   (城市)
    Organization Name (eg, company) [Internet Widgits Pty Ltd]: iHost (企业/组织)
    Organizational Unit Name (eg, section) []: IT  (部门)
    Common Name (eg, YOUR name) []: ibaohost.com   (域名/请正确填写)
    Email Address []:  (可直接回车)
    Please enter the following 'extra' attributes to be sent with your certificate request
     
    A challenge password []:   (直接回车)
    An optional company name []:  (直接回车)
    Use the name of the web-server as Common Name (CN). If the domain name (Common Name) is mydomain.com append the domain to the hostname (use the fully qualified domain name).
     
    其中的Email Address  和 A challenge password 可以留空,不必填写,直接回车。以上需要填写的内容,如果你不清楚应该怎么填写,除了域名,其他的你可以按照上面的内容填写。

    3.执行完 命令后  ,输入命令: ls

      可以看到生成的key和csr文件

      

      执行这些需要在服务器上装了ssl。

    下面还有一种方法:简便的三条命令:

    yum install openssl   安装
    openssl genrsa -out howtoing.com.key 2048   生成key文件  2048位
    openssl req -new -key howtoing.com.key -out howtoing.com.csr   

    howtoing.com可以改成自己的文件名。
     
     
     
  • 相关阅读:
    【Vue】Re19 Promise
    【Vue】Re17 Router 第四部分(参数传递,守卫函数)
    【Vue】Re16 Router 第三部分(懒加载、子路由)
    【Vue】Re15 Router 第二部分(缺省路由、动态路由)
    【Vue】Re14 Router 第一部分(入门案例)
    【Vue】Re13 CLI(Command Line Interface)
    【Vue】Re12 Webpack 第三部分(插件、热部署、配置分离)
    【Vue】Re11 Vue 与 Webpack
    【Vue】Re10 Webpack 第二部分(Loader)
    11-26日测试
  • 原文地址:https://www.cnblogs.com/cx-code/p/10431277.html
Copyright © 2011-2022 走看看