I have generated and downloaded a private .pem key from AWS. However, to use Putty in order to connect to the virtual machine, I must have that key in .ppk format. The process of conversion is detailed in roughly 20 lines here:
I am using Linux Mint (an Ubuntu distro) and I know I can use puttygen in the terminal. However, I have no idea how to use this tool, nor how to configure the needed parameters. When I type puttygen –help I get
PuTTYgen unidentified build, Aug 7 2013 12:24:58
Usage: puttygen ( keyfile | -t type [ -b bits ] )
[ -C comment ] [ -P ] [ -q ]
[ -o output-keyfile ] [ -O type | -l | -L | -p ]
-t specify key type when generating (rsa, dsa, rsa1)
-b specify number of bits when generating key
-C change or specify key comment
-P change key passphrase
-q quiet: do not display progress bar
-O specify output type:
private output PuTTY private key format
private-openssh export OpenSSH private key
private-sshcom export ssh.com private key
public standard / ssh.com public key
public-openssh OpenSSH public key
fingerprint output the key fingerprint
-o specify output file
-l equivalent to `-O fingerprint'
-L equivalent to `-O public-openssh'
-p equivalent to `-O public'
But I have no idea whatsoever on how to do what the website tells me to do and all my tentatives failed so far.
How do I do what the website tells me to do, using puttygen on the terminal?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Using the GUI
See this SO Q&A on how to do exactly what you want, titled: Convert PEM to PPK file format.
excerpt
- Download your .pem from AWS
- Open PuTTYgen, select Type of key to generate as: SSH-2 RSA
- Click “Load” on the right side about 3/4 down
- Set the file type to
*.* - Browse to, and Open your .pem file
- PuTTY will auto-detect everything it needs, and you just need to click “Save private key” and you can save your ppk key for use with PuTTY
Using the command line
If on the other hand you’d like to convert a .pem to .ppk file via the command line tool puttygen, I did come across this solution on SO in this Q&A titled:
excerpt
$ puttygen keyfile.pem -O private -o avdev.ppk
For the public key:
$ puttygen keyfile.pem -L
References
Method 2
If you are using GNU/Linux, you don’t have to use Putty. That part of the tutorial is geared towards Windows users.
Just set your .pem file permissions to r-- by doing chmod 400 mykey.pem then you can pass it straight to ssh :
ssh -i mykey.pem <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8df8fee8ffcdecfafea0e5e2fef9a3ece0ecf7e2e3a3eee2e0">[email protected]</a>
Method 3
use the below command its worked for me in ubuntu
puttygen /home/abc/Downloads/dockerkey1.pem -o home/abc/Downloads/dockerkey1.ppk -O private
Example
puttygen pemKey.pem -o ppkKey.ppk -O private
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0