Wednesday, August 17, 2011

Create Public key using private key

Suppose you lost or misplaced your public key file. Now you only have your private key file and you need to generate public ssh RSA or DSA key to continue with ssh. Yes there is option to create public key using available private key in ssh


root# ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub

In above written command id_rsa in private key that generate public key id_rsa.pub