DevOps | Cloud | Analytics | Open Source | Programming

How To Connect Google Cloud GCP using Putty ?

This post explains How To Connect Google Cloud GCP using Putty . Our objective is to connect to our Google Cloud GCP cluster from local desktop or laptop. We will see step by step how to do that.


  Now Lets follow step-by-step the process to connect Google Cloud GCP using Putty.  

Step 1 - Create SSH Keys

  • Login to GCP Console. And SSH to the VM instance.
  • Create SSH key for a new or guest user . We are creating SSH key for guest1.

testuser@cluster-bdbe-m:~$ ssh-keygen -t rsa -f ~/.ssh/guest1-gcp-ssh-key -C guest1

Generating public/private rsa key pair.

Enter passphrase (empty for no passphrase): Enter same passphrase again: 

Your identification has been saved in /home/testuser/.ssh/guest1-gcp-ssh-key.

Your public key has been saved in /home/testuser/.ssh/

The key fingerprint is:SHA256:v5V9VGN1aIzlA74LC+9IbA1MJLMtrCqw+x4fXD/9Ey4 guest1The key's randomart image is:+---\[RSA 2048\]----+| o . .+..o|| . \* ..o+ o|| + o ..oo.|| . + ...o||. . . S . . .||.. o . o B o.+ . ||o o o \* \*.+.. .|| o o . o +E+o . ||.oo . . o... |+----\[SHA256\]-----+


  • You can locate the key files now . The first file is Private key & the .pub file is the Public key.

testuser@cluster-bdbe-m:~$ pwd
testuser@cluster-bdbe-m:~$ ls -l .ssh/
total 8
-rw------- 1 testuser testuser 1675 Oct 17 16:17 guest1-gcp-ssh-key
-rw-r--r-- 1 testuser testuser  388 Oct 17 16:17

Step 2 - Copy the Public Key Contents to the VM Instance

  • Copy the Public key contents (green colored)

testuser@cluster-bdbe-m:~$ cat .ssh/

V/O6lAuCqbe2rGDX+r25e+/v6TWkjgPx3 guest1


  • Go to GCP Dashboard --> VM Instances --> Choose and click on the VM where you had SSHed in Step1.
  • Above step will take you to the below screen. Click on the Edit .

  • Go the SSH Key section and Paste the COPIED contents of the Public Key. And Click Save at the bottom.

  • So basically we linked the Public Key with the VM instance in this Step.

Step 3 - Download the Private Key

  • Next we download the Private key file .
  • This downloaded file will be used to connect through Putty.
  • Follow the screenshot to download the Private key file to your local Laptop or Desktop.

Step 4 - Convert the GCP Key to Putty's PPK Format

  • The raw ssh key file downoaded from GCP doesn't directly work with Putty. We need to convert it to Putty's PPK format.
  • We will use Puttygen which comes as part of installing Putty.
  • Load the downloaded file.
  • Then save it as private key( ppk format).

Step 5 - Use the PPK file to connect GCP

  • Launch Putty
  • Use the External IP of the VM . See below -

  • Next Click Auth and Browse and locate the putty private key or ppk file created in Step 4 .  Once you select the ppk file, click OPEN in the window shown below.

  • It opens the GCP Terminal . For us , as we see below it shows the username as guest1 (since we created the key for a user named GUEST1). Now you can carry on with your tasks on the Terminal.

Hope you find this post helpful.  

Additional Read from my Blog -