Allow only specific IP to SSH to Linux server

To allow only specific IP to ssh to your linux server add the entry below into your firewall config file. Usually, the firewall config file is found in /etc/sysconfig/iptables:

-A INPUT -s x.x.x.x/x -p tcp -m state –state NEW -m tcp –dport 22 -j ACCEPT

x.x.x.x = your originating ssh communcation and/or the ONLY server you want to allow to SSH to your linux system
NOTE: the /x after x.x.x.x is the subnet number. so if your subnet is; then entry above should read x.x.x.x/23