So I have this VPS which is basically the thing which hosts the website you’re reading this on. The VPS also hosts other applications so security is a concern of mine since access is entirely remote. I do have fail2ban
installed though.
Although I’m getting better at it I mucked about with my /etc/ssh/sshd_config
file and configured the daemon to liste on a non-standard port. I then promptly forgot to add an iptables entry to allow traffic on this port, essentially locking myself out of the VPS.
What I used to do in a situation like this is to simply rebuild the entire machine but this has become very expensive because I have to re-install a bunch of software and redo complicated configuration.
Instead of rebuilding the machine because I can’t get access via SSH what I didn’t know is that my VPS has a panel applet that allows local access to a login terminal. I can then log into the VPS with username/password and update the sshd_config
as necessary.