#!/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