Created
December 30, 2019 15:34
-
-
Save 1N0T/4ec81a774e4ce2079a7e940af85f59d9 to your computer and use it in GitHub Desktop.
(bash) Generación de un ertificado autofirmado (clave pública y clave privada)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Este script crea un certificado autofirmado. | |
# Clave privada: fichero.key | |
# Clave pública: fichero.crt | |
DOMINIO=mi.servidor.net | |
DIASVALIDEZ=3650 | |
CLAVEPRIVADA=$DOMINIO.key | |
CLAVEPUBLICA=$DOMINIO.crt | |
openssl req -x509 -nodes -days $DIASVALIDEZ -newkey rsa:2048 \ | |
-subj /CN=$DOMINIO \ | |
-keyout $CLAVEPRIVADA \ | |
-out $CLAVEPUBLICA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment