SSH Keys

Managing SSH keys for secure server access.

SSH keys are used by hav.sh to securely connect to your servers. They work like a digital key pair — a private key that hav.sh keeps safe, and a public key that your server trusts.

#Private keys

A private key is what hav.sh uses to authenticate with your server. You add private keys to hav.sh so it can connect to your servers on your behalf.

#Adding a private key

#1. Navigate to Infrastructure Settings

In the sidebar, go to Infrastructure Settings and select Private Keys.

#2. Add a new key

Click New Private Key and fill in:

  • Name — A label to identify this key (e.g., "Hetzner Production Key")
  • Private Key — Paste the contents of your private key file

#3. Save the key

hav.sh will validate the key format and store it securely. You can now select this key when adding servers.

Never share your private key with anyone. hav.sh stores it encrypted, but you should still treat it as a sensitive credential.

#Public keys

Public keys control who can connect directly to a server via SSH. They are managed separately from private keys and can be assigned to specific servers.

#Adding a public key

  1. Go to Infrastructure Settings and select Public Keys
  2. Click New Public Key
  3. Paste the public key and give it a name
  4. Assign it to one or more servers

When assigned, hav.sh automatically deploys the public key to the server's authorized keys file.

#Common questions

How do I generate an SSH key pair?

If you don't have an SSH key yet, your cloud provider usually generates one when you create a server. You can also create one on your local computer — your hosting provider's documentation will have instructions for your operating system.

Which key formats are supported?

hav.sh supports RSA, Ed25519, and ECDSA key formats. Ed25519 is recommended for the best security.

Can I use the same key for multiple servers?

Yes. You can add one private key to hav.sh and use it when connecting to multiple servers, as long as the corresponding public key is authorized on each server.