Skip to content

Instantly share code, notes, and snippets.

@1N0T
Created December 30, 2019 15:34
Show Gist options
  • Save 1N0T/4ec81a774e4ce2079a7e940af85f59d9 to your computer and use it in GitHub Desktop.
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)
#!/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