Generate openssh private/public keys, convert public key to PEM format 

Joined:
04/09/2007
Posts:
784

October 12, 2013 13:06:55    Last update: October 12, 2013 13:06:55
  1. Generate the ssh keys:
    $ ssh-keygen -t rsa
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/drxi/.ssh/id_rsa): mykey
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in mykey.
    Your public key has been saved in mykey.pub.
    The key fingerprint is:
    a1:1e:2a:31:7f:b1:12:0d:f9:e7:57:55:d5:86:3c:0a drxi@jungle
    The key's randomart image is:
    +--[ RSA 2048]----+
    |             . .=|
    |     .    E   +.o|
    |    o   .  . ..o |
    |     + . .  ..   |
    |  o . * S   .    |
    |   + + *   .     |
    |  . + + . .      |
    |   . o   .       |
    |                 |
    +-----------------+
    

  2. Convert the ssh public key to PEM format:
    $ cd .ssh
    ~/.ssh$ ssh-keygen -f mykey.pub -e -m PKCS8 >mykey.pem.pub
    

Share |
| Comment  | Tags