Friday, 14 August 2020

Generate .pem file from .ppk file

 Introduction

I recently came across a requirement from our DBA Team wherein they needed to access a server on Oracle Cloud and all they had was a .ppk file received from the App Team that managed the OCI server. Since the source server from which we had to connect did not have a GUI, we needed to generate a corresponding .pem file to use on the command line.

For this, I installed putty on a lab machine.


yum install putty


 I then used the .ppk file to generate a .pem file using the following command:


puttygen oci.ppk -O private-openssh -o oci.pem


This step did prompt me for the passphrase for the .ppk file which I was are of.

To login to the OCI server, I used .pem file by specifying the -i option with the ssh command as follows.


-bash-4.1$ ssh -i oci.pem opc@11.59.17.209

Enter passphrase for key 'oci.pem':

Last login: Thu Aug 13 07:17:30 UTC 2020 from 10.22.88.26 on pts/0

Last login: Thu Aug 13 07:18:17 2020 from 10.22.88.26


The passphrase was the same one I was prompted for while generating the .pem file.


Conclusion

This concludes this post on how to generate a .pem file from a .ppk file. I hope you found the post to be useful.

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...