How to create public key from SSH private key?

Lost SSH public key, don’t worry, you can generate it from your private key file. If you have an SSH private key, you can generate the public key using the ssh-keygen command.

-y option will read a private OpenSSH format file and print an OpenSSH public key to stdout.
-f specifies the location of your private key file.

Example

ssh-keygen generate public key

If you have passphrase set, ssh-keygen will prompt for the password.

See SSH, ssh-keygen

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published.