Generate Public SSH Key From Private SSH Key

January 12, 2024 in memos.

If you have a Privacy SSH key but need to regenerate the public key again, use ssh-keygen -y

-y This option will read a private OpenSSH format file and print an OpenSSH public key to stdout

ssh-keygen -y -f ~/.ssh/id_ed25519 > ~/.ssh/id_ed25519.pub
Enter passphrase: 

This will save the public key to ~/.ssh/id_ed25519.pub.

Tags: crypto ssh