This is just a quick write on the hosts.allow and deny files. You can lookup “spawn” and/or “twist” for some advanced usage.
So to limit an IP address, or a IP range access to SSH, do the following
Deny all incoming request for SSH
Edit the “hosts.deny” file
add the following line
sshd : ALL
Now edit “hosts.allow” and allow the client IP, or IP range to access SSH
add the following line to allow a single IP
sshd : 192.168.1.182
If you want to allow the whole subnet, then replace the above line with this one
sshd : 192.168.1.
hosts.allow overrides hosts.deny. So you deny everything and then allow exceptions.