2020-06-08 18:59:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-06-08 19:20:39 +00:00
|
|
|
apt upgrade || exit 10
|
|
|
|
apt install -y tmux ufw || exit 15
|
|
|
|
|
2020-06-08 20:42:47 +00:00
|
|
|
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
|
|
|
|
|
2020-06-08 19:20:39 +00:00
|
|
|
ufw allow ssh || exit 20
|
2020-06-08 20:17:30 +00:00
|
|
|
yes | ufw enable
|
2020-06-08 20:42:47 +00:00
|
|
|
|