ssh-keygen -t ed25519 -C 'you@example.com'Create a modern SSH key pair.
SSH key generation, authorized_keys management, ssh-keyscan, host keys, ssh-agent, ssh-add, and certificate basics.
Create, inspect, and convert SSH keys.
ssh-keygen -t ed25519 -C 'you@example.com'Create a modern SSH key pair.
ssh-keygen -t rsa -b 4096 -C 'you@example.com'Create an RSA key pair for compatibility when needed.
ssh-keygen -t ed25519 -f ~/.ssh/id_work_ed25519 -C 'work key'Write a key pair to a chosen file.
ssh-keygen -t ed25519 -N '' -f ~/.ssh/id_ci_ed25519Skip passphrase prompts, usually only for automation accounts.
ssh-keygen -p -f ~/.ssh/id_ed25519Update the passphrase on an existing private key.
ssh-keygen -lf ~/.ssh/id_ed25519.pubPrint the fingerprint of a public key file.
ssh-keygen -lvf ~/.ssh/id_ed25519.pubDisplay a visual fingerprint representation.
ssh-keygen -y -f ~/.ssh/id_ed25519 > ~/.ssh/id_ed25519.pubRegenerate the public half from a private key.
Install keys and inspect remote host keys.
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@example.comAppend your public key to a remote account's authorized_keys.
ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 2222 user@example.comUse ssh-copy-id with a non-default SSH port.
ssh-keyscan example.comFetch a server host key without logging in.
ssh-keyscan -H example.com >> ~/.ssh/known_hostsAppend a scanned host key to your known_hosts file.
ssh-keygen -F example.comSearch known_hosts for a specific host entry.
ssh-keygen -R example.comDelete stale host key entries for a host.
ssh-keygen -H -f ~/.ssh/known_hostsHash hostnames in known_hosts for privacy.
ssh-keygen -s ~/.ssh/ca_host -I host-web01 -h -n web01.example.com /etc/ssh/ssh_host_ed25519_key.pubCreate a host certificate from a host CA key.
Manage agent sockets and loaded identities.
eval "$(ssh-agent -s)"Start an agent and export its environment variables.
ssh-add ~/.ssh/id_ed25519Load the default identity into ssh-agent.
ssh-add -lShow fingerprints of identities currently loaded in the agent.
ssh-add -LPrint public keys currently loaded in the agent.
ssh-add -d ~/.ssh/id_ed25519Delete a specific key from the agent.
ssh-add -DClear all identities from the agent.
ssh-add -c ~/.ssh/id_ed25519Load a key that prompts for confirmation on each use.
ssh-add -t 1h ~/.ssh/id_ed25519Load a key that expires automatically from the agent.