From cd77719bedf90e0f1a5dc80fec63338946501590 Mon Sep 17 00:00:00 2001 From: archos Date: Fri, 24 May 2024 18:39:51 +0200 Subject: [PATCH] skript setup opraven --- setup_server.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup_server.sh b/setup_server.sh index 2bd4648..b879ed0 100644 --- a/setup_server.sh +++ b/setup_server.sh @@ -50,9 +50,12 @@ echo "y" | sudo ufw enable # Změna SSH konfigurace sudo sed -i "s/#Port 22/Port $SSH_PORT/" /etc/ssh/sshd_config -sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config +sudo sed -i 's/#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config +sudo sed -i 's/PermitRootLogin .*/PermitRootLogin no/' /etc/ssh/sshd_config sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config +sudo sed -i 's/PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config sudo sed -i 's/#PubkeyAuthentication yes/PubkeyAuthentication yes/' /etc/ssh/sshd_config +sudo sed -i 's/PubkeyAuthentication .*/PubkeyAuthentication yes/' /etc/ssh/sshd_config # Restart SSH služby, aby se změny projevily if systemctl list-units --type=service | grep -q "ssh.service"; then