Skip to main content

Generate SSH Key

macOS / Linux

Open Terminal and run:

ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/ctms-hetzner

Press Enter when prompted for a passphrase (or set one for extra security).

View and copy your public key:

cat ~/.ssh/ctms-hetzner.pub

Windows

Open PowerShell and run:

ssh-keygen -t ed25519 -C "your-email@example.com" -f $env:USERPROFILE\.ssh\ctms-hetzner

View your public key:

Get-Content $env:USERPROFILE\.ssh\ctms-hetzner.pub
Windows alternatives
  • Git Bash: same commands as macOS / Linux
  • PuTTYgen: open it → Generate → save public/private keys

Online Generator (No Install)

Use showdns.net/ssh-key-generator to generate a key pair in your browser — no software needed.

  1. Open the link → select Ed25519
  2. Click Generate
  3. Download the private key and save it as ~/.ssh/ctms-hetzner (or any name)
  4. Copy the public key and paste it during VM creation
caution

Online generators are convenient for non-production use. For production servers, generate keys locally using the terminal commands above.


Connect to a Server

# macOS / Linux
ssh -i ~/.ssh/ctms-hetzner root@<server-ip>

# Windows PowerShell
ssh -i $env:USERPROFILE\.ssh\ctms-hetzner root@<server-ip>

If using a .pem file shared by a teammate:

chmod 600 ~/path/to/key.pem        # macOS/Linux only — fix permissions
ssh -i ~/path/to/key.pem root@<server-ip>

Add Key to a Server

Paste your public key during Hetzner VM creation (see Hetzner VM), or copy it after:

ssh-copy-id -i ~/.ssh/ctms-hetzner.pub root@<server-ip>