未找到 Certbot

Sti*_*985 5 ssl lets-encrypt ubuntu-16.04 certbot

我使用以下命令在我的 ubuntu 16.04 机器上安装了 Letencrypt。

sudo apt-get install letsencrypt
Run Code Online (Sandbox Code Playgroud)

现在,我想定义一个 cronjob 以使用以下行自动更新我的证书。

certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Run Code Online (Sandbox Code Playgroud)

但我总是收到错误,即找不到命令 certbot。

如果我使用 letencrypt 而不是 certbot 一切正常,只要我不使用--pre-hook--post-hook

如何安装certbot或是否有让letsencrypt 定义此类钩子的替代命令?

谢谢

Moh*_*out 19

对我来说,以下命令工作正常。

安装卡扣

sudo apt update

sudo apt install snapd
Run Code Online (Sandbox Code Playgroud)

安装核心

sudo snap install core
Run Code Online (Sandbox Code Playgroud)

安装证书机器人

sudo snap install --classic certbot

sudo ln -s /snap/bin/certbot /usr/bin/certbot
Run Code Online (Sandbox Code Playgroud)

更新Certbot

sudo certbot renew --dry-run
Run Code Online (Sandbox Code Playgroud)

  • 运行这些并得到:“certbot:找不到命令” (2认同)

mrt*_*rts 7

按照官方说明certbot进行安装

sudo snap install --classic certbot
Run Code Online (Sandbox Code Playgroud)

或者,在没有snap,的较旧的 Ubuntu 中

sudo apt install certbot python3-certbot-nginx
Run Code Online (Sandbox Code Playgroud)

它将在那之后可用$PATH


Sti*_*985 5

好吧,我找到了解决方案..

git clone git@github.com:certbot/certbot.git

cd certbot

./certbot-auto renew --pre-hook "service nginx stop" --post-hook "service nginx start"