I have a little remote server that I can access only with SSH, and what I want to do, is block all the traffic except port 22 for SSH.
The first time, what I did was :
iptables -P INPUT DROP
And of course, it locked me up because I didn't let any input traffic, so I couldn't add the following rules to accept SSH traffic.
How can I block all the traffic (except SSH) and in the same time letting me have access to the server through SSH?