To restrict SSH access to a server from particular IP addresses

To restrict the SSH access to a server from a particular IP address or addresses, we need to give two entries in the files ‘/etc/hosts.allow’ and ‘/etc/hosts.deny’ respectively. The entries are as given below:

——–
cat /etc/hosts.allow | grep sshd
sshd,sshdfwd-X11: IP1,IP2

cat /etc/hosts.deny | grep sshd
sshd,sshdfwd-X11:ALL
——–

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: