Skip to content

What is an SSH key?

An SSH key is a way to sign in to a server without typing a password. It comes in two matching halves: you keep one, the server keeps the other, and when you connect, your half proves to the server that you hold it.

  • Nobody can guess it. A password can be guessed or tried over and over. A key is far too long and random for that.
  • The secret never travels. When you sign in with a password, the password itself is sent to the server. With a key, only proof that you hold the key is sent, so a fake server or someone listening learns nothing they can reuse.
  • One key, many servers. You can put the same key on all your servers, and take it off one server without changing the others.

Every SSH key comes as a pair:

  • The private key is the secret half. It stays with you, on your devices, and is never given to anyone. Whoever has it can sign in as you.
  • The public key is the half you hand out. It is one line of text that starts with its type, for example ssh-ed25519 AAAA.... You put it on each server you want to sign in to. On its own it cannot sign anyone in, so it is safe to share.

A server keeps the public keys it accepts in a file called ~/.ssh/authorized_keys, one line for each key.

Ed25519 is the type to pick unless a server asks for something else. It is modern, fast and short, and almost every server accepts it. It is what ZestSSH makes by default.

RSA 4096 is for an older server that does not take Ed25519. ECDSA is there for setups that require it. See Key management for every type.

A passphrase is a password that locks the private key itself, so a copy of the key file is useless without it.

ZestSSH keeps your keys in your device’s secure storage (below), so a key made in the app has no passphrase of its own. You can add one, change it or take it off at any time. A key you import with a passphrase keeps it, and ZestSSH asks for the passphrase once and saves it with the key, so you are not asked each time you connect. See Add, change or remove a passphrase.

  • Encrypted on your device. Private keys, passwords and passphrases are kept in your system’s secure storage: the keychain on a Mac, iPhone or iPad, the Android Keystore, Windows’ data protection for your Windows account, or your Linux desktop’s secret store. They are never written to the disk unencrypted. Turn on Encrypt data at rest (with the app lock) to put them behind your PIN as well. See Data at rest.
  • Synced end to end, only if you sync. If you turn on sync, your keys go to your other devices encrypted on this device first, with a sync password only you know. The storage they pass through only ever sees encrypted data. If you do not sync, your keys stay on the device, unless you export them or make a backup. See Sync encryption.

Open Keys (in the side rail on a computer, under Manage on a phone, under More on a tablet) and add one:

  • Generate a new key: ZestSSH makes an Ed25519 key for you.
  • Import a key file you already have, such as ~/.ssh/id_ed25519 or a PuTTY .ppk file, or paste one.
  • Use a security key such as a YubiKey: on a phone held to it or plugged in, on a computer through your SSH agent.
  • On a computer, use the keys in your SSH agent, or sign in with a password kept in your password manager (1Password, Bitwarden or KeePassXC).

The steps for each are on Key management and in the Keys guide.

The server has to know your public key before you can sign in with the key. To get it there you need one more way in, usually the password the server came with.

With ZestSSH. Select the key on the Keys page and choose Install on hosts… (on a phone, open the key and tap the server icon). Pick the hosts: ZestSSH signs in to each one and adds the public key to its ~/.ssh/authorized_keys, the way ssh-copy-id does, and tells you for each host whether it worked. It works on servers that run Linux, BSD or macOS. See Install a key on hosts.

With ssh-copy-id. If the key is also in a file on a computer with OpenSSH (Export… on the key writes it to files), run:

Terminal window
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server.example.com

By hand. Copy the public key line (Copy public key on the key in ZestSSH), sign in to the server, and add the line to the end of ~/.ssh/authorized_keys.

After that, set the host’s Key field to the key and connect: no password asked.