From 587f795ddf16404ff181fc80555c4b3090e68db9 Mon Sep 17 00:00:00 2001 From: "Gaunt, John" Date: Thu, 10 Jan 2019 11:06:33 -0500 Subject: [PATCH] added CA --- update.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/update.sh b/update.sh index 1b85fbc..47a69fa 100644 --- a/update.sh +++ b/update.sh @@ -3,6 +3,8 @@ # Update and isntall the packages unsed in my homelab # run "curl -L https://johnhgaunt.com/update.sh | bash" as root to use this script +GAUNT_CA_CERT_NAME="GauntDC01-CA.crt" + # need to be root if [ "$EUID" -ne 0 ]; then echo "Please run as root" @@ -27,6 +29,10 @@ if [ -f /etc/debian_version ]; then # modify ssh to allow root login and then restart the service sed --in-place "s/^.PermitRootLogin\ prohibit-password/PermitRootLogin\ yes/" /etc/ssh/sshd_config systemctl restart sshd + + # GauntDC01-CA + curl -o /usr/local/share/ca-certificates/${GAUNT_CA_CERT_NAME} https://johnhgaunt.com/${GAUNT_CA_CERT_NAME} + update-ca-certificates # CentOS OS elif [ -f /etc/redhat-release ]; then @@ -52,6 +58,12 @@ elif [ -f /etc/redhat-release ]; then # modify ssh to allow root login and then restart the service sed --in-place "s/^#PermitRootLogin\ yes/PermitRootLogin\ yes/" /etc/ssh/sshd_config systemctl restart sshd + + # GauntDC01-CA + curl -o /etc/pki/ca-trust/source/anchors/${GAUNT_CA_CERT_NAME} https://johnhgaunt.com/${GAUNT_CA_CERT_NAME} + update-ca-trust + + else echo "Unable to determine linux distro"