How/Syntax to allow SSH connection on server – /etc/hosts.allow

SSH is secured shell protocol which is using to connect remotly and securly. We can control the SSH connection to a server by using the following files:

# /etc/hosts.allow
# /etc/hosts.deny

Allow an IP address from SSH connection:
Syntax:

------
sshd : IP-Address
------

Allow more than one IP
Syntax:

------
sshd : IP-Address1, IP-Address2, IP-Address3
------

Allow IP range:
Syntax:

------
sshd : 33.*.*.*
sshd : 66.66.*.*
------

Allow all IP addresses from SSH
Syntax:

------
sshd : ALL
------

Or

------
ALL : ALL
------

We can also control the same from /etc/hosts.deny file by adding the keyword ‘ALLOW’
Example:

# vi /etc/hosts.deny
------
sshd : ALL : ALLOW
------

🙂 🙂 🙂

Related Links:
How to manage SSH permission for custom users under your server
How to create a banner/welcome-note for SSH server
How to disable SSH login as root user – PermitRootLogin
/etc/hosts.deny

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

Leave a Reply

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