How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Reading Time: 3 minutes

The GCP console interface is very useful, but sometimes you may need to directly SSH from your on-premise infrastructure.

This is particularly common after you migrate a Linux server from your own premises to GCP as the Google Daemon which provides Google Cloud console access typically will not be installed.

If you are interested in the Google Daemon you can check here.

Windows Method using Putty

Open the Putty Key Generator from the putty folder on your start menu.

Click generate and follow on screen prompt to wiggle mouse to create randomness

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Keep wiggling the mouse to generate the key

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Enter the Username and password you want to use in the Key Comment and Key Passphrase sections. In this example I am using root, but you can use anything providing there is an associated account on the server.

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Next copy the entire key box and click Save private key

Next Log into GCP and navigate to Compute Engine. Find the VM you want external SSH access to and click on it to see details.

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

In the details page click edit

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Scroll down to the SSH Keys section, Click Add item and paste you key value and user name

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Click save and make a note of the external IP of the server.

Go back to Putty.

Type the External IP of your server into the client

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

On the left pane, scroll down to expand connection > SSH > Auth

Click the browse button and locate the key file you saved earlier

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

Next click Open to SSH to you GCP Instance. Log in with the credentials you provided earlier.

, How to SSH directly to Google Cloud Platform (GCP) Linux instance?

You may also like...

Leave a Reply

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