I've just installed Ubuntu 24.04 LTS and I'm running into some really strange issues with SSH. Sometimes, I can log in just fine but then I get disconnected during my session, along with a man-in-the-middle warning when I try to log back in. This has happened from multiple devices trying to connect to the same server. I've tried it on another fresh install of 22.04 LTS, and the problem persists. The server is hosted on a Hyper-V cluster and I've literally started fresh with the VM a few times. Interestingly, my home server running 24.04 LTS with the same SSH default configuration has no issues at all, and I'm just using username/password for authentication, no key-based auth here. I couldn't find anything relevant through Google; most hits are about rotating keys rather than explaining why they might change mid-session. However, I just realized I may have an IP conflict causing these issues!
1 Answer
Sounds like you might have an IP conflict going on. Have you shut down your machine and checked if another device is using that static IP? It could be why you're getting kicked out and seeing those man-in-the-middle warnings! That could explain the weird behavior you’re experiencing.

Haha, turns out you were right! I found an old VM with the same IP still running. I feel pretty dumb for missing that, but thanks for the help!