Certbot
es una maravillosa herramienta que puedes utilizar para generar un certificado SSL con Let's Encrypt e instalarlo y configurarlo automáticamente en tu servidor web.
Estos certificados se renuevan cada 60 días de forma automática y una vez configurado ya no te tienes que preocupar de si tu web está protegida con SSL o no.
Pasos previos
Para poder realizar este tutorial es necesario que tengas configurado algún dominio en tu servidor, ya hayas configurado un Nginx o Apache para que responda al nombre de dominio.
También es importante que el dominio esté bien configurado a nivel de DNS para que apunte al servidor. Si el domino no apunta al servidor no podremos crear el certificado.
Instalación de Certbot
Simplemente para instalar Certbot únicamente debes de ejecutar el siguiente comando:
apt install certbot
Si por ejemplo estás usando Nginx, es recomendable instalar también este paquete para que te detecte la configuración automáticamente:
apt install python3-certbot-nginx
Si por lo contrario tienes Apache, el paquete para que detecte la configuración automáticamente es:
apt install python3-certbot-apache
Instalar certificado SSL con Certbot
Simplemente tenemos que ejecutar el comando:
certbot
Y la salida del comando seguirá de la siguiente forma:
# certbot
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): micorreo@midominio.com
Deberemos de escribir una cuenta de correo existente.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017-w-v1.3-notice.pdf.
You must agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Y luego aceptaremos los ToS.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to share your email address with the Electronic Frontier Foundation, a founding partner of the Let's Encrypt project and the non-profit organization that develops Certbot? We'd like to send you email about our work encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N
Account registered.
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: midominio.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Tras aceptar las newsletter, nos mostrará un listado de dominios que haya detectado en nuestro servidor para poder generar un certificado. Seleccionaremos el dominio mediante el número que hay delante.
Una vez seleccionado, se generará el certificado:
Requesting a certificate for midominio.com
Performing the following challenges:
http-01 challenge for midominio.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/default
Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/default
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled
https://midominio.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/midominio.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/midominio.com/privkey.pem
Your certificate will expire on 2022-11-25. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again with the "certonly" option. To non-interactively
renew *all* of your certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
Y listo, ya tenemos SSL configurado en nuestra web!
Comentarios