Access your application gear using SSH with PuTTY

Step 1. Convert SSH Keys to Putty format.

Note: You need to execute this step only once.

When rhc tools are installed, your SSH keys are created in the OpenSSH format. This format differs slightly from the PuTTY format. In this step, we'll import the OpenSSH key that you have created earlier and convert it to native PuTTY format.

If you have PuTTY and PuTTYgen already, continue; otherwise, download PuTTY and PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/.

Start PuTTYgen and select Conversions -> Import Key

 

By default, OpenSSH stores your keys in drive:\Documents and Settings\user\.ssh folder on WindowsXP, or in drive:\Users\user\.ssh folder on Windows 7. In the file selector, navigate to this folder and select id_rsa file that contains your private key.

You may see another file that is actually a public key id_rsa.pub -- Windows may misidentify it as a 'Microsoft Publisher' file. If you try to select id_rsa.pub, Puttygen errors that this file does not contain a private key.

Once imported, you will see the following imported information in Puttygen.

 

Then, click on Save private key and choose the same drive:\Documents and Settings\user\.ssh folder. The file name defaults to id_rsa.ppk.

You should now have three files in this folder: OpenSSH private key id_rsa, PuTTY private key id_rsa.ppk and public key id_rsa.pub.

 

We will use this key in the following sections when accessing your application securely.

Step 2. Determine username and host name.

The FAQ referenced above refers to the UUID and Gear Name. In PuTTY, this fields have to be separated.

You can find the UUID and gear name information in the OpenShift management console by selecting your application.

The string with the git repository contains the required information:

Step 3. Establish SSH connection using PuTTY.

Start PuTTY and paste Gear name as the Host Name as shown below:

Then, navigate to Connection->Data in the left panel and paste the complete UUID as the Auto-login username, as shown below. Since the UUID is quite long, it may not fully display.

Lastly, navigate to Connection->SSH->Auth and select the id_rsa.ppk as your Private key file for authentication, as shown below:

Finally, select Open to connect to your Application's gear.

Be careful with the shell access since you may accidentally damage your application.

One of the useful capabilities of SSH access is viewing your applications logs. To access logs, use the following commands. "demo3" here is my application's name.

> cd demo3/logs 
> ls 
> view error_log-20120607-000000-EST

To disconnect, type exit.

Hi Khusid, I did everything as the tutorial suggests (rhc setup, generating public key, and converting it into ppk.....) but when it come to the final step -- connecting with Putty, it always issue an error:

Disconnected: No supported authentication methods available.

By the way, I am working on windows 7. Strangely, I can connect to my openshift space via "git bash", so my public key should be ok, it must be something wrong with the putty or the ppk, am I right?

Anyway, those are just my guesses, don't know the exact reason, could you help check this, thank you very much:)

Thank you! Works perfectly to connect Putty to my OpenShift applications through SSH.

Finally!! Thank you very very much! I've been searching around for a while and all i could find were partially/bad guides.

Thanks, awesome!

I had tha same problem that ksimon.acc had. Putty displays an error message: Disconnected: No supported authentication methods available. (server sent: publickey,gssapi-keyex,gssapi-with-mic) Some help?

Oops, my fault! I saved private key as id_rsa.pub.ppsk and the public key as id_rsa.ppsk so i was pointing to wrong file. Thanks!

when i try to do this and click open, it says something about not recognising the server and the ssh key seems to be different to my one i uploaded
ps i am doing the tutorial on how to set up a minecraft server on openshift
EDIT: Now after a few seconds without this message, it says Fatal error:Connection Timed Out

Can you validate that you're using the "Gear Name" for "Putty's Host Name" setting in step 3 (without the http://)?

If this is a brand new app, you might want to create another application and try it on that new app as well - just in case DNS resolution might have caused an issue with the other app.

HTHs;
~Nam

Very usefull, thanks.

Thx, very usefull after searching for a while !!!

Hi, I didn,t find th file .pub. I install rhc tools correctly over Windows 8, but i have a problem with this file. Help me please.

Have you generated the ssh key as per instructions? Otherwise you will not find pub key.

Thank you. this works for me.

This is awesome. It worked like a gem.

After four hours, you helped me. Thank!