Setting Up SSH Access on a Fresh Hetzner VPS
- Generate SSH Key (if not already)
On your local machine:ssh-keygen -t rsa -b 4096 - Add Public Key to Hetzner
In the Hetzner dashboard, go to Security > SSH Keys
Paste the content of~/.ssh/id_rsa.pub - Rebuild or Deploy VPS
Select your OS and attach your SSH key during setup. - Connect via SSH
ssh root@<your-server-ip>
First login may ask for a password (sent by email) and prompt you to change it. - Fix Host Key Mismatch (if rebuilding)
If you get a “REMOTE HOST IDENTIFICATION HAS CHANGED” error:ssh-keygen -R <your-server-ip>Then reconnect:ssh root@<your-server-ip>
You’re now in with secure SSH key access.