I hope someone knows this answer to this, every day it seems i have to block new ips from trying to access my server via SSH using this: iptables -I INPUT -s 111.111.111.111 -j DROP What i would like to do is just block access to SSH for every IP except for mine, does anyone know how to do this? Thanks for your help
There are lots of things you can do to accomplish this. I use multiple methods, but iptables would definitely be the most effective one for you. You can exclude your own IP with '!', like this: iptables -I INPUT -s ! <your ip address/network> -p tcp --dport 22 -j DROP Code (markup): Some other suggestions to increase security: Run SSH on a port other than 22 Disable direct root login Use AllowUsers to limit the accounts that are allowed to login Restrict password access and use SSH keys instead Hope that helps.