SSL and Certificates Guide

SSL/SSH 证书用户指引

SSL 证书

通配符证书

# macOS 
sudo certbot certonly --preferred-challenges dns --manual -d "*.DOMAIN"

安装

# macOS
brew install certbot

删除

运行 certbot delete 选择需要删除的证书。

SSH 证书登录

文件 作用
~/.ssh/authorized_keys 已登陆公钥
~/.ssh/config 预定义可 SSH 登录的服务器

~/.ssh/config 示例

SSH 登录用私钥需要 chmod 400 保护权限,Windows 下也用 ~ 引用用户目录。

Host DOMAIN.com
  HostName DOMAIN.com
  User root
  IdentityFile "~/Library/Mobile Documents/com~apple~CloudDocs/KEY_FILE.key"

证书转换

pfx 转 crt 和 key 文件

openssl pkcs12 -clcerts -nokeys -out FILE_NAME.crt -in FILE_NAME.pfx
openssl pkcs12 -nocerts -nodes -out FILE_NAME.key -in FILE_NAME.pfx
Author: njun
njun's picture
Updated: 2023/09/30