From 6ea6be823862209116b40308db1be6e2d60cd8db Mon Sep 17 00:00:00 2001 From: "N.Andreopoulos" Date: Mon, 4 Aug 2025 23:52:27 -0400 Subject: [PATCH] Update Setup.sh --- Setup.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Setup.sh b/Setup.sh index 6239811..359b8ee 100644 --- a/Setup.sh +++ b/Setup.sh @@ -12,25 +12,28 @@ if [ "$(id -u)" -ne 0 ]; then exit 1 fi -echo "[1/6] Updating system..." +echo "[1/7] Updating system..." apt update && apt upgrade -y -echo "[2/6] Installing required packages..." +echo "[2/7] Installing required packages..." apt install -y sudo curl -echo "[3/6] Setting up SSH key for root..." +echo "[3/7] Installing Docker..." +curl -fsSL https://get.docker.com/ | sudo sh + +echo "[4/7] Setting up SSH key for root..." mkdir -p "$SSH_DIR" chmod 700 "$SSH_DIR" touch "$AUTHORIZED_KEYS" grep -qxF "$SSH_KEY" "$AUTHORIZED_KEYS" || echo "$SSH_KEY" >> "$AUTHORIZED_KEYS" chmod 600 "$AUTHORIZED_KEYS" -echo "[4/6] Disabling password login for SSH..." +echo "[5/7] Disabling password login for SSH..." sed -i 's/^#\?\s*PasswordAuthentication\s\+.*/PasswordAuthentication no/' /etc/ssh/sshd_config sed -i 's/^#\?\s*ChallengeResponseAuthentication\s\+.*/ChallengeResponseAuthentication no/' /etc/ssh/sshd_config sed -i 's/^#\?\s*UsePAM\s\+.*/UsePAM no/' /etc/ssh/sshd_config -echo "[5/6] Setting SSH login banner..." +echo "[6/7] Setting SSH login banner..." cat << 'EOF' > /etc/issue.net \033[1;34m AUTHORIZED ACCESS ONLY @@ -48,11 +51,11 @@ EOF sed -i 's|^#\?\s*Banner\s\+.*|Banner /etc/issue.net|' /etc/ssh/sshd_config -echo "[6/6] Restarting SSH service..." +echo "[7/7] Restarting SSH service..." if command -v systemctl &>/dev/null; then systemctl restart sshd else service ssh restart fi -echo "[✔] Setup complete. System updated, SSH secured, and banner set." +echo "[✔] Setup complete. System updated, Docker installed, SSH secured, and banner set."