I have an Ubuntu 11.04 server in a remote location on another continent, so I have no physical access to it. I only interact with it by
scp), and intend to only ever interact with it that way.
For security purposes, I want to ensure that absolutely all ports on the server are closed, except for
My understanding is still vague, despite having tried to find instructions on the web. What I've gathered so far is that I need to "flush" the "iptables", and also that I need to edit some files (
/etc/hosts, maybe?), and reboot the machine.
Obviously, though, I want to be very careful about this, because if I do it wrong, I could end up accidentally shutting down the ssh port, making the server inaccessible to me. If that happens, I have to go to the server administrator, who will reinstall the server, and make fun of me in the process.
I'm not a server admin guru by any stretch, so I'm looking to establish a fool proof set of steps before I do this.
So, how do I shut down all ports while still preserving my access?
Bonus question: While doing this, should I, and can I, change the
ssh port from 22 to a non-standard one? Does it really make a difference?