-
Securing Raspberry Pi’s SSH Connection
Source: pimylifeup.com
-
update and install
sudo apt update
sudo apt upgrade
sudo apt install fail2ban
-
make backup copy and edit
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local
-
look for section [sshd], add or change to
[sshd]
enabled = true
filter = sshd
port = ssh
banaction = iptables-multiport
bantime = 1800
maxretry = 3
logpath = %(sshd_log)s
backend = %(sshd_backend)s
bantime is in seconds (-1 is indefinitely)
save and exit
-
start
sudo service fail2ban restart