This is an old revision of the document!
Check for password attempts: ``` # grep “Failed password” /var/log/auth.log ``` and ``` cat /var/log/auth.log ```
Restrict IP address (whitelist): ``` sudo nano /etc/hosts.allow ``` and add the following lines to allow the whitelisted IP blocks to your public SSH. ``` sshd: 192.168.x.x/32, … ```
Also, Open up /etc/hosts.allow file using your favorite text editor: ``` sudo nano /etc/hosts.deny ``` and add the following lines to deny all SSH connections to your public SSH port
``` sshd: ALL ```
https://cloudcone.com/docs/article/how-to-restrict-ssh-access-only-to-specific-ips/