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.
Add a key
Section titled “Add a key”Import a key file, or pipe the key in:
flint key add laptop --file ~/.ssh/id_ed25519pbpaste | flint key add deploy --key-stdinFlint parses the key before storing it. If the key has a passphrase, give it with
--passphrase (Flint asks for it) or --passphrase-stdin:
flint key add laptop --file ~/.ssh/id_ed25519 --passphraseA 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.
A key without its passphrase
Section titled “A key without its passphrase”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_ed25519Added key 'laptop' (ssh-ed25519 SHA256:…).flint: key 'laptop' is encrypted and its passphrase is not stored: it is asked for at each connectFlint 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.
See and manage keys
Section titled “See and manage keys”flint key listflint key show laptop # type, SHA-256 fingerprint and public keyflint key rename laptop work-laptopflint key rm work-laptopOutput 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 "").
Use a key
Section titled “Use a key”Link a key to a host directly, or through a credential:
flint host edit web-01 --key laptop