From 40bec6a4438d2e8b79b15d63c3134afc0e20d795 Mon Sep 17 00:00:00 2001 From: petep Date: Wed, 13 Aug 2025 08:33:28 +0000 Subject: [PATCH] Update 'prep-grid-vm.sh' --- prep-grid-vm.sh | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/prep-grid-vm.sh b/prep-grid-vm.sh index 88ad948..b3e1fe4 100644 --- a/prep-grid-vm.sh +++ b/prep-grid-vm.sh @@ -36,11 +36,33 @@ setup_tf_users() { configure_ssh() { echo "Configuring SSH" - wget https://docs.grid.tf/threefold_public/public/raw/branch/master/sshd_config - mv sshd_config /etc/ssh/ - systemctl restart ssh + ubuntu_version=$(lsb_release -rs) + + if [[ "$ubuntu_version" == "22.04" ]]; then + echo "Detected Ubuntu 22.04 — replacing sshd_config and restarting ssh service" + wget -q https://docs.grid.tf/threefold_public/public/raw/branch/master/sshd_config -O /etc/ssh/sshd_config + systemctl restart ssh + + elif [[ "$ubuntu_version" == "24.04" ]]; then + echo "Detected Ubuntu 24.04 — updating ssh.socket for port 34022" + wget -q https://docs.grid.tf/threefold_public/public/raw/branch/master/sshd_config -O /etc/ssh/sshd_config + mkdir -p /etc/systemd/system/ssh.socket.d + cat > /etc/systemd/system/ssh.socket.d/port.conf <