#!/bin/bash ####################################################################################################################### # Harden Guacd <-> Guac client traffic in TLS wrapper # For Ubuntu / Debian / Raspbian # David Harrop # April 2023 ####################################################################################################################### # To delete and reissue a new cert # sudo keytool -delete -alias guacd -noprompt -cacerts -storepass changeit -file guacd.crt # Prepare text output colours GREY='\033[0;37m' DGREY='\033[0;90m' GREYB='\033[1;37m' LRED='\033[0;91m' LGREEN='\033[0;92m' LYELLOW='\033[0;93m' NC='\033[0m' #No Colour # Check if user is root or sudo if ! [[ $(id -u) = 0 ]]; then echo echo -e "${LRED}Please run this script as sudo or root${NC}" 1>&2 exit 1 fi TOMCAT_VERSION=$(ls /etc/ | grep tomcat) RSA_KEY_LENGTH=2048 # Below variables are automatically updated by the 1-setup.sh script with the respective values given at install (manually update if blank) CERT_COUNTRY= CERT_STATE= CERT_LOCATION= CERT_ORG= CERT_OU= CERT_DAYS= clear # Create the special directory for guacd tls certificate and key. mkdir -p /etc/guacamole/ssl echo cat <