Latest News

Limit SSH Access to Specific Clients by IP Address

  • Ivan Ivanov
  • Security
Limit SSH Access to Specific Clients by IP Address

For example, to allow traffic from 192.168.0.0/24 network and otherwise, drop the traffic (to port 22). The DROP rule is not required if your iptables default policy is configured to DROP.


iptables -A INPUT -p tcp --dport 22 --source 192.168.0.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP
23 seconds