dev-scripts/scripts/debian10/install-base.sh

17 lines
514 B
Bash
Raw Normal View History

2020-09-03 17:07:38 +00:00
#!/bin/sh
ssh -T $ssh << EOSSH
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
export DEBIAN_FRONTEND=noninteractive
apt-get install -y ufw || (echo "ERROR while installing ufw" ; exit 15)
2020-09-03 17:07:38 +00:00
ufw allow ssh || (echo "Error while configuring ufw to allow ssh" ; exit 20 )
yes | ufw enable
EOSSH