From bff3859156192b999479a51c4f200d005c22365f Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 8 Jun 2020 21:42:47 +0100 Subject: [PATCH] configure ssh --- server-install-base.sh | 6 ++++++ 1 file changed, 6 insertions(+) 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 +