There are many ways available to secure SSH on cPanel Server. We can deny SSH access to all other ip address except from our ISP ips.  In order to allow our ip address and deny all other ips use the following method.

From within your WHM head to Security Center >> Host Access Control.
Here we can add in some rules to control who can access sshd.

Example

Daemon            Access List                              Action                         Comments
sshd              115.119.26.146                           allow                         working ISPs
sshd              ALL                                      deny                          Deny all other ips

 

Limit SSH per IP and user
You can limit ssh using /etc/hosts.deny and /etc/hosts.allow. We can use instead of this will deal with the AllowUsers feature in SSH that will limit access per user, and if desired per ip.

To enable this edit /etc/ssh/sshd_config (default location on centos servers, this may be different for you).

At the very bottom you can add

AllowUsers root

This will limit access to only user root. All other login attempts will fail. This will stop the chance of a brute force attach getting into your server as any user but root.

You can also add an IP address

AllowUsers [email protected] [email protected]

This above setting will allow user root from 115.119.26.146 user admin from 15.19.26.146

Restart SSHD service

You must restart SSH for the changes to take place. On centos servers that is /etc/init.d/sshd restart type service sshd restart in console/terminal or go to Restart Services >> SSH Server (OpenSSH).

0.00 avg. rating (0% score) - 0 votes
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive