mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/scripts.git
synced 2025-10-03 15:01:00 +08:00
14 lines
306 B
Bash
Executable file
14 lines
306 B
Bash
Executable file
#!/bin/sh
|
|
|
|
sed -i 's/#?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
|
|
systemctl restart sshd
|
|
|
|
apt update
|
|
apt install -y fail2ban vim
|
|
apt purge -y vim-tiny cryptsetup-initramfs
|
|
|
|
cat > /etc/fail2ban/jail.d/sshd.conf << EOT
|
|
[sshd]
|
|
mode = aggressive
|
|
EOT
|
|
systemctl restart fail2ban
|