14 lines
389 B
Bash
Executable File
14 lines
389 B
Bash
Executable File
#!/bin/sh
|
|
|
|
apt upgrade -y || exit 10
|
|
apt install -y tmux ufw curl || 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
|
|
|