CentOS 7 – SSH IP Restriction

If you want only the IP addresses you have specified to enter SSH in Centos 7, you can easily perform the process with the following 2 arrangements.

The first file to be edited is “/etc/hosts.allow”. Here we allow SSH connection from “” ip.


Now we are editing the “/etc/hosts.deny” file. Here we deny connection from anywhere.


sshd: All

You do not need to restart the system to complete the process.

You May Also Like

About the Author: admin

Leave a Reply

Your email address will not be published. Required fields are marked *