How to generate SSH public key from private key

Normally you will generate and store a pair of SSH public and private key. But do you know you can generate public key from private key with ease? Here is the trick:

  1. For OpenSSH key: Open terminal and type:
ssh-keygen -y
  1. For PuTTY key: Open PuttyGen program and choose Load key. Public key will show up.

Have fun.