diff --git a/server-install-base.sh b/server-install-base.sh index 238516b..87801fc 100755 --- a/server-install-base.sh +++ b/server-install-base.sh @@ -3,5 +3,11 @@ apt upgrade || exit 10 apt install -y tmux ufw || exit 15 +sed -i '/PubkeyAuthentication/c\PubkeyAuthentication yes' /etc/ssh/sshd_config +sed -i '/PasswordAuthentication/c\PasswordAuthentication no' /etc/ssh/sshd_config +sed -i '/PermitRootLogin/c\PermitRootLogin prohibit-password' /etc/ssh/sshd_config +systemctl restart sshd + ufw allow ssh || exit 20 yes | ufw enable +