Limit SSH access By IP Address

Secure your server more, and prevent brute force attacks, you can limit SSHd to certain IP addresses by manipulating the /etc/hosts.allow file and the /etc/hosts.deny file.

Open /etc/hosts.allow

Use the following command to open the hosts.allow file:

vi /etc/hosts.allow

Once this file is open, add the following line:

SSHD : ipaddress : ALLOW

Open /etc/hosts.deny

Use the following command to open the hosts.deny file:

vi /etc/hosts.deny

Once it opens, add the following line to the file:

SSHD : ALL : DENY

Save and exit, and you have successfully limited SSH access by IP address.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.