Skip to content
Releases

SSH keys

Flint stores SSH private keys by content, inside the vault. There is no key file to keep on disk next to it, and the vault works the same on every machine you sync it to.

Import a key file, or pipe the key in:

Terminal window
flint key add laptop --file ~/.ssh/id_ed25519
pbpaste | flint key add deploy --key-stdin

Flint parses the key before storing it. If the key has a passphrase, give it with --passphrase (Flint asks for it) or --passphrase-stdin:

Terminal window
flint key add laptop --file ~/.ssh/id_ed25519 --passphrase

A wrong passphrase, a public key or anything that is not an SSH private key is refused. Flint keeps the passphrase too (encrypted), so it never has to ask for it again.

You can also store an encrypted key without its passphrase. Flint reads its public half, which the OpenSSH key format keeps unencrypted, so the fingerprint is the one ssh-keygen -l shows:

$ flint key add laptop --file ~/.ssh/id_ed25519
Added key 'laptop' (ssh-ed25519 SHA256:…).
flint: key 'laptop' is encrypted and its passphrase is not stored: it is asked for at each connect

Flint then asks for the passphrase each time it uses the key, up to three tries, and wipes it from memory afterwards. In the desktop app the prompt has Store passphrase in the vault. Tick it and the passphrase is saved (encrypted) once it has opened the key, so later connections do not ask. The CLI asks on the terminal and never saves it.

An older PEM key (-----BEGIN RSA PRIVATE KEY----- with Proc-Type: 4,ENCRYPTED) encrypts its public half too, so it still needs its passphrase when you add it. In the app, leave Passphrase empty in Add key to store an OpenSSH key without it.

Terminal window
flint key list
flint key show laptop # type, SHA-256 fingerprint and public key
flint key rename laptop work-laptop
flint key rm work-laptop

Output shows the public key and fingerprint only. The private key and the passphrase are never printed, with or without --json.

A key that a host or a credential uses cannot be removed. Unlink it first (flint host edit <alias> --key "").

Link a key to a host directly, or through a credential:

Terminal window
flint host edit web-01 --key laptop