操作系统:Ubuntu 20.04
# 用 root 帐户登录
apt update -y
apt install -y curl
apt install -y socat
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --register-account -m xxx@xxx.xxx
# xxx@xxx.xxx 填写邮箱地址,更换真实邮箱成功率更高
~/.acme.sh/acme.sh --issue -d xxxx.xxxx.xxx --standalone
# xxxx.xxxx.xxx 更换为您要解析的域名
~/.acme.sh/acme.sh --installcert -d xxxx.xxxx.xxx --key-file /root/private.key --fullchain-file /root/cert.crt
# 此步完成后会在 /root 目录下看到证书公钥/root/cert.crt 及 密钥文件/root/private.key