Skip to content

Instantly share code, notes, and snippets.

@tomer
Created February 11, 2017 13:38
Show Gist options
  • Save tomer/11089f78936a17985ebaae107fc2f8d8 to your computer and use it in GitHub Desktop.
Save tomer/11089f78936a17985ebaae107fc2f8d8 to your computer and use it in GitHub Desktop.
Manually obtain Let's Encrypt certificate over SSH using sshfs
#!/bin/bash
mkdir example.net
fusermount -u example.net
sshfs ssh-user@example.net:/var/www/example.net example.net
certbot -w example.net/ -d example.net -m webmaster@example.net --agree-tos --config-dir .config --work-dir .work --logs-dir .logs certonly --webroot
fusermount -u example.net
rmdir example.net
echo
echo Certificate has been created. Now please install the certificate on your website.
echo
echo File path: `pwd`/.config/live/example.net
echo Private key: privkey.pem
echo Certificate: cert.pem
echo CA certificate: fullchain.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment