Ssh – Solaris 11 sshd brute force protection. DenyHosts equivalent for Solaris 11

brute-force-attacksdenyhostssolarissshx86

I'm getting regular attempts to brute force ssh on a x86 solaris 11.1 server. On linux I use DenyHosts to block connections after a number of incorrect login attempts. Is there a similar package for Solaris 11.1 or any recommendations on other alternative ways to prevent brute force of ssh?

Best Answer

Any recommendations on other alternative ways to prevent brute force of ssh?

Change the port SSH runs on. Brute force attempts are largely done against port 22.

$ sudo grep ^Port /etc/ssh/sshd_config 
Port 10022

Limit the users that are allowed to connect, for example:

$ sudo grep ^AllowUsers /etc/ssh/sshd_config 
AllowUsers dannix
AllowUsers gene@192.168.3.*
AllowUsers bill@172.16.0.100

Disable root login:

$ sudo grep ^PermitRootLogin /etc/ssh/sshd_config 
PermitRootLogin no

Use public key authentication rather than passwords.

Disable password based authentication (only do this if you use public key authentication):

$ sudo grep ^PasswordAuthentication /etc/ssh/sshd_config 
PasswordAuthentication no

Additionally, you can use firewall rules to restrict what remote hosts can access SSH on your system.