Skip to Content

You’ve been watching this SAP CodeTalk or following this tutorial on how to setup your SAP HANA, express edition, (or HXE) with the Google Cloud Launcher. Now you would like to connect to the instance from some SSH client, such as PuTTY or the console on your Mac or Linux computer.

You need the SSH keys, but where are they? If this is your first project and you have not generated your keys before, chances are that you won’t find them in your .ssh folder as this tutorial indicates:

No need to panic. There’s just one more additional command before you can download your public and private keys.

Open a new gcloud console that is not logged in to the virtual machine using the “prompt” icon on the top-right corner:

 

Take note of the name of your VM and use it to replace accordingly in the following command:

gcloud compute ssh <<YOUR VM NAME>>

It will ask for confirmation, issue a couple of warnings about not having any keys, ask for a passphrase (please use something you will remember) and finally confirm that your keys have been generated:

Notice that it has logged you into the VM. In order to retrieve the keys, open a new gcloud console to fetch them from the project home folder:

Go into your /home/<<google_user_id>>/.ssh and use the download icon to fetch your private and public SSH keys:

 

Now you can connect from another console in your Mac or Linux computer using your key with:

ssh -i ~/.ssh/my-ssh-key your_gmail_user_name@external_vm_IP_address

or using PuTTY or WinSCP to transfer files from your Windows computer. More information on the latter or If you are getting an error like Unable to use key file “some path and private key” (OpenSSH SSH-2 private key) in this tutorial.

 

I’d love to know what you develop with your HXE instance, let us connect on  or on LinkedIn !

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. robert rex

    Wow! Hi Miss @Lucia Subatin, thank you very much for such as a very helpful article. No doubt the SSH keys are very valuable for identifying ourselves to an SSH server. Due to this modern web design companies can maintain the integrity of their business data with ease.

    (1) 
  2. Jon Gooding

    Thanks for this! Just to add if you are using putty;

    1. The file google_compute_engine needs to be saved as a google_compute_engine.pem
    2. Then run the puttygen.exe to convert it to a google_compute_engine.ppk

    Then you are good to go in 3rd party putty.

    Cheers

    Jon

    (0) 

Leave a Reply