cmdxray / commands / ssh-keygen

What does ssh-keygen do?

generate, manage and convert SSH authentication keys.

▸ Explain your own ssh-keygen command →

ssh-keygen examples, explained

$ ssh-keygen -t ed25519 -C you@example.com

  • ssh-keygengenerate, manage and convert SSH authentication keys
  • -ttype of key to create (ed25519, rsa, ecdsa)
  • ed25519value for -t
  • -Ccomment to attach to the key (often your email)
  • you@example.comvalue for -C

$ ssh-keygen -R oldhost

  • ssh-keygengenerate, manage and convert SSH authentication keys
  • -Rremove all keys for the given hostname from known_hosts
  • oldhostvalue for -R

$ ssh-keygen -y -f id_rsa

  • ssh-keygengenerate, manage and convert SSH authentication keys
  • -yread a private key and print its public key
  • -fkey file to write to or read from
  • id_rsavalue for -f

ssh-keygen flags & options

-ttype of key to create (ed25519, rsa, ecdsa)
-bnumber of bits in the key
-Ccomment to attach to the key (often your email)
-fkey file to write to or read from
-Nnew passphrase for the key ('' means no passphrase)
-pchange the passphrase of an existing private key
-yread a private key and print its public key
-lshow the fingerprint of a key file
-Rremove all keys for the given hostname from known_hosts
-Fsearch known_hosts for the given hostname
-qquiet — suppress the usual output

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.