Skip to content

Convert private key generated via OCI Console to ppk

I am pretty new on the Oracle Cloud Infrastructure technology, so maybe I am talking about something you already know. But anyway I prefer to share this case: it can help if you encounter the same problem as me. Let’s take the risk to have too much information rather than nothing! 😉

The problem

I was doing some tests on the new MySQL Database Service and during the setup I decided to generate my ssh keys via the OCI console:

When I tried to connect via PuTTY or MobaXterm to my compute instance using the opc account and my private key (generated previously), I got the following error:

Looking at the keys generated via the Oracle Cloud console, I saw that they were defined in the following format:

The solution

Actually I don’t work directly on a Linux system. So I need to convert my private key if I want to make it usable via my connection tools.
First step is to transform it to RSA format. I can do it using OpenSSL:

# openssl rsa -in ssh-key-2020-11-24.key -out ssh-key-2020-11-24.rsa

Second and last step is to convert it to ppk format. I can do it using PuTTYgen.
I load the private key:

I filter on all files types:

I select my RSA key and I click on Open:

I click on Ok on the following message:

and then on Save private key:

So I save the key with a ppk format:

Tests

I can now use my private key to connect to my OCI compute instance via PuTTY:

or MobaXterm:

Hope this can help you!

Let’s work together

Ready to operate at
the next level?

Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

Oracle Team

Oracle Team

Posts published under the Oracle Team account are collective contributions by the dbi services Oracle consultants. The practice covers the full Oracle Database lifecycle: architecture, migration and upgrade, high availability with RAC and Data Guard, backup and recovery, performance tuning, and engineered systems such as Oracle Database Appliance and Exadata. The team holds Oracle certifications up to Certified Master level and operates customer platforms under service level agreements.View Author posts

1,009 posts since December 2010

Leave a Comment

Your email address will not be published. Required fields are marked *