So, I have some semi real world troubleshooting to do.. I find that I am unable to ssh into my Hetzner vps. It hangs for a while and eventually returns a connection timeout. I’ve double checked the configuration on the client side and it has not changed. I haven’t tried in about 3 days, but it was working fine. I have managed to get in through the web console and, with ss -tunlp, can see that sshd is indeed listening on my custom ssh port (12345 for the sake of this discussion).
systemctl status shows that sshd.service is running and sshd.socket is disabled. That is a mystery because I had left it enabled. Does it only enable on connection?
firewall-cmd --list-all still shows 12345/tcp in ports just as I had left it.
Aha.. I missed the lower levels of the OSI model. I have the Hetzner firewall (yes, I have 2 firewalls) pinned down to only allowing traffic from the IP address that my ISP doled out. That IP has changed. Updating it solved the problem.
Well, that means that whomever got my old IP address technically had access to my server if they had the ssh keys, which I never share. What is a better way to secure this VPS while I am piecing things together? Or am I overkilling it, meaning keeping my SSH keys secure is sufficient? Or maybe pay the extra money for a static IP?