Connecting to a Fresh Hetzner VPS with SSH: Quick Setup Guide

Setting Up SSH Access on a Fresh Hetzner VPS

  1. Generate SSH Key (if not already)
    On your local machine:
    ssh-keygen -t rsa -b 4096
  2. Add Public Key to Hetzner
    In the Hetzner dashboard, go to Security > SSH Keys
    Paste the content of ~/.ssh/id_rsa.pub
  3. Rebuild or Deploy VPS
    Select your OS and attach your SSH key during setup.
  4. Connect via SSH
    ssh root@<your-server-ip>
    First login may ask for a password (sent by email) and prompt you to change it.
  5. 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.