ssh-keygen: Cheat Sheet

Published: October 7, 2020

Learn essential commands for generating, managing, and converting SSH authentication keys with this quick reference guide. Perfect for system administrators and security professionals!

ssh-keygen is a tool for generating, managing, and converting authentication keys for SSH.

Generate RSA key pair, with passphrase and no prompts

ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "passphrase"

Generate RSA key pair, with no passphrase and no prompts

ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""

Remove host from list of known hosts

ssh-keygen -R hostname

Set new passphrase on existing key

ssh-keygen -p -f ~/.ssh/id_rsa

Visualize known host keys

ssh-keygen -lv -f ~/.ssh/known_hosts