From 0cc2b94c7e4b56142453a5aa05c0ef0024c60f0c Mon Sep 17 00:00:00 2001 From: bach Date: Sat, 18 Nov 2023 11:26:36 +0100 Subject: [PATCH] updated sshd config --- bin/ssh.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/ssh.sh b/bin/ssh.sh index 3fea90f..40a88a2 100755 --- a/bin/ssh.sh +++ b/bin/ssh.sh @@ -14,8 +14,13 @@ if [ "$EUID" -ne 0 ]; then exit fi -sed -i 's/PermitRootLogin\ yes/PermitRootLogin no/g' /etc/ssh/sshd_config -sed -i 's/PermitEmptyPasswords\ yes/PermitEmptyPasswords no/g' /etc/ssh/sshd_config -sed -i 's/Protocol\ [0-9]/Protocol 2/g' /etc/ssh/sshd_config +# sed -i 's/PermitRootLogin\ yes/PermitRootLogin no/g' /etc/ssh/sshd_config +# sed -i 's/PermitEmptyPasswords\ yes/PermitEmptyPasswords no/g' /etc/ssh/sshd_config +# sed -i 's/Protocol\ [0-9]/Protocol 2/g' /etc/ssh/sshd_config + +touch /etc/ssh/sshd_config.d/custom.conf +echo "PermitRootLogin no" >> /etc/ssh/sshd_config.d/custom.conf +echo "PermitEmptyPasswords no" >> /etc/ssh/sshd_config.d/custom.conf + systemctl reload ssh echo -e "\033[92;1mSSH secured\033[Om"