Get the latest tech news

Stop MitM on the first SSH connection, on any VPS or cloud provider


blished on 8 May 2026 This little script stops attacks on the first SSH connection to a new VM, even on providers (like Hetzner Cloud) that don't offer a proprietary solution; we only need cloud-init, which is widely supported. Summary (for experts; read on for a longer explanation): inject a temporary SSH host (private) key via cloud-init, and trust that temporary SSH host key just long enough to generate and retrieve the "real" (long-term) SSH host keys.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of SSH

SSH

Photo of MitM

MitM

Photo of VPS

VPS

Related news:

News photo

K3sup – bootstrap K3s over SSH in < 60s

News photo

Who Is That Knocking at My (SSH) Door?

News photo

My audio interface has SSH enabled by default