root@172-17-218-79 \~\]# **mkdir cert** \[root@172-17-218-79 \~\]# **cd cert/** \[root@172-17-218-79 cert\]# **openssl genrsa -out server.key 1024** Generating RSA private key, 1024 bit long modulus (2 primes) ......+++++ .........................................+++++ e is 65537 (0x010001) \[root@172-17-218-79 cert\]# **openssl req -new -key server.key -out server.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) \[AU\]: State or Province Name (full name) \[Some-State\]: Locality Name (eg, city) \[\]: Organization Name (eg, company) \[Internet Widgits Pty Ltd\]: Organizational Unit Name (eg, section) \[\]: Common Name (e.g. server FQDN or YOUR name) \[\]:server Email Address \[\]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password \[\]: An optional company name \[\]: \[root@172-17-218-79 cert\]# **openssl x509 -req -in server.csr -out server.crt -signkey server.key -days 9999** Signature ok subject=C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = server Getting Private key \[root@172-17-218-79 cert\]# ll total 12 -rw-r--r-- 1 root root 818 Dec 6 15:29 **server.crt** -rw-r--r-- 1 root root 627 Dec 6 15:29 server.csr -rw------- 1 root root 887 Dec 6 15:28 **server.key** 思路: 1. 生成私钥 2. 生成请求文件 3. 签名+x509封装
相关推荐
姚青&5 分钟前
Linux 文件处理命令枷锁—sha11 分钟前
【CTFshow-pwn系列】03_栈溢出【pwn 072】详解:无字符串环境下的多级 Ret2Syscall 与 BSS 段注入zjeweler25 分钟前
阿里云服务器利用宝塔搭建个人博客网站计算机安禾1 小时前
【Linux从入门到精通】第21篇:Shell脚本开篇——什么是Shell?写第一个Hello World坚持就完事了1 小时前
Linux中的cp命令2301_800976931 小时前
Linux的基本命令原来是猿2 小时前
线程安全的单例模式zjeweler2 小时前
宝藏网站推荐:云服务器特惠与网安学习资源的一站式聚合平台尘世壹俗人2 小时前
如何检查服务器上消耗资源的程序是那个时空自由民.2 小时前
Linux,ESP IDF,NuttX OS使用的项目编译管理构建体系Kconfig + Kbuild(或基于 Make/CMake 的构建系统)