From 6cde24300528b5b2f8163ff177d8bea505a51fda Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Mar 2024 12:53:37 +0100 Subject: [PATCH] clear known_hosts --- cd-bootstrap.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/cd-bootstrap.sh b/cd-bootstrap.sh index 85c1259..a6045ad 100755 --- a/cd-bootstrap.sh +++ b/cd-bootstrap.sh @@ -1,20 +1,28 @@ +KEY_ALGORITHM='ed25519' +KEY_PATH=".ssh/id_ed25519" +KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' +PACKAGES=( +'python3' +'rsync' +'tree' +) +SERVER="$(basename ${GITHUB_SERVER_URL})" + # ssh -mkdir --parents ~/.ssh +mkdir '.ssh' \ +|| exit -echo "${CD}" > ~/.ssh/id_ed25519 +echo "${CD}" > "${KEY_PATH}" \ +|| exit unset CD -chmod 400 ~/.ssh/id_ed25519 +chmod '400' "${KEY_PATH}" \ +|| exit -echo -n "\ -|1|BcccCTMLpM9HHSgJmPu/FFOwOv0=|+3BKK02xibpCPxQ9Nghi2GbXLng= \ -ssh-ed25519 \ -AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5 -" > ~/.ssh/known_hosts +echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ +> '.ssh/known_hosts' \ +|| exit # packages -apt-get install --yes \ -'python3' \ -'rsync' \ -'tree' \ +apt-get install --yes "${PACKAGES[@]}"