Keychain and SSH keys
Generate SSH keys, install them on servers, check their health and rotate them across every host.
Keychain and SSH keys
The Keychain page lists the SSH keys Harbor knows about and the saved passwords, with a health check for each key.
Add keys
- Import from ~/.ssh adds the key files in your
.sshfolder. - Keys you generate in Harbor, and keys chosen in a host’s settings, are added automatically.
- Remove takes a key off the list. The key file itself isn’t deleted.
Harbor keeps only the path to each key file. Private keys stay where they are on your disk and are read when you connect.
Key health
Each key shows its type, fingerprint and the hosts that use it, and is flagged when it:
- is weak (RSA under 2048 bits) or uses DSA, which modern servers reject,
- has no passphrase,
- is older than two years, or
- is missing from disk.
Generate a key
Click Generate key on the Hosts page, or Generate new next to the key file in the host editor. Choose:
- Ed25519 (recommended): small, fast and secure.
- RSA (2048, 3072 or 4096 bits; 4096 by default) for older servers.
- ECDSA (256, 384 or 521 bits).
Add a passphrase to protect the key if someone copies the file. Harbor never overwrites an
existing file. The private key is saved readable only by you, with the public key next to it as
.pub.
Install a key on a server
To log in with a key, its public half must be in the server’s ~/.ssh/authorized_keys.
- On the Keychain page, choose Install on a host… next to a key. Harbor connects with the host’s current login and adds the key.
- Or, in a terminal tab’s menu, choose Install public key on server… and pick a
.pubfile, likessh-copy-id.
Harbor creates ~/.ssh and authorized_keys with the right permissions if needed, and doesn’t add
a key twice. Then switch the host to SSH key authentication.
Rotate a key
Rotate key replaces a key everywhere it’s used:
- Harbor creates a new Ed25519 key (with a passphrase if you give one).
- It installs the new key on every host that used the old one, logging in with the old key.
- It switches those hosts to the new key.
Hosts it can’t reach keep the old key and are listed so you can retry. The old key file, and its
line in each server’s authorized_keys, are left for you to remove once you’ve checked everything
works.
Background jobs like these only connect to servers whose host key you have already trusted.
Saved passwords
The Keychain also lists which hosts have a saved password or passphrase. The secrets themselves are never shown. See Vault and master password for how they’re protected.