From caaf96cedb6197ced37b46ce829580134861b66d Mon Sep 17 00:00:00 2001 From: Franscobec Date: Sat, 31 Jan 2026 21:58:41 -0500 Subject: [PATCH 1/2] Update renewkeys.sh --- renewkeys.sh | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/renewkeys.sh b/renewkeys.sh index a17051a..4a9e8a8 100644 --- a/renewkeys.sh +++ b/renewkeys.sh @@ -9,9 +9,6 @@ PC=$(uname -n | awk '{print $1}') guardband() { if [ $? -ne 0 ]; then -echo -e "${CY}Cleaning up temp directory for checksums...${NF}" -rm -rf /.SSH/.temp -sleep 2 echo -e "${CR}Script Exited with an Error.${NF}" exit 1 fi @@ -26,29 +23,13 @@ if ! wget --spider "$CDN" 2>/dev/null; then return 1 else echo -e "${CG}CDN available for checksum downloads - ${FB}Proceeding...${NF}" + serversidePUB=$(wget https://cdn.franscorack.com/chksum/sshprov/pub -q -O -) + serversidePRIV=$(wget https://cdn.franscorack.com/chksum/sshprov/priv -q -O -) sleep 2 fi } -downloadpub(){ -wget -q https://cdn.franscorack.com/chksum/sshprov/pub -O /.SSH/.temp/pub -if [ $? -ne 0 ]; then - echo -e "${CR}Download error: CDN reported error in file download${NF}" - return 1 -fi -} - -downloadpriv(){ -wget -q https://cdn.franscorack.com/chksum/sshprov/priv -O /.SSH/.temp/priv -if [ $? -ne 0 ]; then - echo -e "${CR}Download error: CDN reported error in file download${NF}" - return 1 -fi -} - rootcheck(){ -serversidePRIV=$(cat /.SSH/.temp/priv | awk '{print $1}') -serversidePUB=$(cat /.SSH/.temp/pub | awk '{print $1}') if [ -f /root/.ssh/id_ed25519 ]; then rootPRIV=$(sha256sum /root/.ssh/id_ed25519 | awk '{print $1}') else @@ -207,19 +188,11 @@ if [ "$PC" = "pve01" ] then verifycdn guardband -downloadpub -guardband -downloadpriv -guardband rootcheck guardband else verifycdn guardband -downloadpub -guardband -downloadpriv -guardband rootcheck guardband admincheck -- 2.49.1 From 9e37c6b5221d29da5623ff898204027ac1fd2005 Mon Sep 17 00:00:00 2001 From: Franscobec Date: Sat, 31 Jan 2026 22:03:42 -0500 Subject: [PATCH 2/2] Fix known_hosts rm to detect if file is present first --- renewkeys.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renewkeys.sh b/renewkeys.sh index 4a9e8a8..eb881cb 100644 --- a/renewkeys.sh +++ b/renewkeys.sh @@ -179,8 +179,12 @@ if [ "$UID" -ne 0 ]; then fi echo -e ${CY}Warning: running this script resets known_hosts file. Abort this script using CTRL+C if you want to avoid that.${NF} sleep 3 +if [ -f /home/$USER/.ssh/known_hosts ]; then rm /home/$USER/.ssh/known_hosts +fi +if [ -f /root/.ssh/known_hosts ]; then rm /root/.ssh/known_hosts +fi if [ ! -f ".SSH/.temp" ]; then mkdir /.SSH/.temp fi -- 2.49.1