Allow and deny IP for ssh in Linux
vi /etc/host.deny
sshd:192.168.100.5
Save & exit
This will deny 192.168.100.5 to ssh.
Suppose we want to allow only 192.168.100.5 to ssh. Then we will edit two files as follows:
vi /etc/host.deny
sshd:all
save & exit
vi /etc/host.allow
sshd:192.168.100.5
save & exit
We can do the same by changing only at /etc/host.deny as follows:
vi /etc/host.deny
sshd:all except 192.168.100.5
save & exit
No comments:
Post a Comment