I've recently set up an ubuntu server on an old Dell Optiplex. I can remote in via ssh when on the same network. However, when I try to ssh in from a different network using the public IP, I get the following error:
kex_exchange_identification: Connection closed by remote host
I have searched this error on this forum as well as many others and have tried many different ways to fix this error, but nothing has worked so far. I have port forwarded to the server's static IP, I've allowed OpenSSH and opened port 22 on my server through UFW, and I've set up a VPN that connects my computer to my network. None of these have worked so far.
What am I doing wrong? If anyone has any other ideas that I could try, or anything that I should quadruple check that would be fantastic. Thanks so much.