I was wondering how I could deny all SSH logins from any IP but mine? This would be using IPTables.
-
@Paul I honeslty didnt know where to start... I am not too fond of IPTables – user1307079 Mar 6 '13 at 0:46
There are multiple ways to do this using iptables - From the command line:
/sbin/iptables -I INPUT -s MY.IP -p tcp --dport 22 -j ACCEPT /sbin/iptables -I INPUT -p tcp --dport 22 -j DROP
You can do a similar thing leaving out the /sbin/iptables, adding it near the top of /etc/sysconfig/iptables and then doing a restart.
If you want to steer clear of IPTables altogether you can simply modify the SSHD config by adding the following line to the end of /etc/ssh/ssd_config (and then restarting sshd)
AllowUsers myuser@my.ip.address
(If there is more then one user you can use the form AllowUsers myuser@my.ip myuser2@myip myuser3@my.ip )
Looks like you need to configure iptables as @davidgo has mentioned. Adding:
-A RH-Firewall-1-INPUT -s 192.168.1.1 -m state --state NEW -p tcp --dport 22 -j ACCEPT
to your /sbin/iptables might work (change the ip to the desired address).