putty generate pem fiel code example

Example 1: how to convert ppk to pem in linux

1.install putty-tools with the following command:
	sudo apt-get install putty-tools
2.Now convert your .ppk file to .pem using the following command:
	puttygen yourkey.ppk -O private-openssh -o yourkey.pem
3.Set the proper permission to use the .pem file with following command:
	chmod 400 yourkey.pem
4.Connect to you server using the following command
	ssh -i yourkey.pem serverusername@server-ip

Example 2: convert pem to ppk

Convert .pem to .ppk file format Using Putty(Windows)
 
To convert the .pem file .ppk follow below points
 
	1. First you need to download Putty from here.
	2. Then run puttygen to convert .PEM file to .PPK file.
	3. Start puttygen and select “Load”
	4. Select your .PEM file.
	5. Putty will convert the .PEM format to .PPK format.
	6. Select “Save Private Key” A passphrase is not required but can be used if additional security is required.