Retrieve/regenerate ssh public key from private key

SSH public key can be retrieved from the private key if it’s lost.

From man page of ssh-keygen:

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

ssh-keygen -y [-f input_keyfile]

Command:

$ ssh-keygen -y -f ~/.ssh/id_dsa > ~/.ssh/id_dsa.pub

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。