FinepherFinepher
AR
DevOps 2 min read

Connect Your Google Cloud VM on Your Terminal

Asha Vardhan

Asha Vardhan

April 9, 2026

Hello folks,

I wanted to share a quick tip with you all. I've noticed many of you are connecting to Google Cloud VM SSH through the browser, which can be a real-time-suck.

Did you know you can connect directly from your computer's terminal? It's super easy and takes less than 2 minutes!

Here's how:

Step 1: Create Key pair

First, create a private and public key pair on your computer. To do this, open your terminal and run:

Or, for more customization:

ssh-keygen -t rsa -b 2048 -f ./key-name -C "your_email@example.com"

it will ask you to enter a passcord. you can just enter if you don't want to add it. replace key-name with any name you want.

it will create 2 files. for my example the files are as follows,

key-name -> Private key

key-name.pub -> Public Key

Works on Windows, Ubuntu, Linux, and Mac OS!

Step 2: Add Public key to Google Cloud VM meta

Now that we have our private and public key pair, let's add the public key to your Google Cloud VM metadata.

In order to do that.

  1. Login to Google Cloud

  2. Navigate to Compute Engine

  3. Click on 'Metadata' under Settings

  4. Select the 'SSH Keys' tab

Then Click the Edit link from the top nav menu as see you In the following image

Then you will see an option to ADD ITEM, an input field will show up when you click the button. copy and paste the content of the key-name.pub file. and Press SAVE

Step 3: Connect to your VM using SSH

You are almost done now. just connect the VM to your terminal

Open Command prompt/PowerShell/Terminal as per your OS and run this command

ssh -i <path-to-your-private-key-dir>/key-name username@<server-public-ip>

it may ask you to enter the code which you are using on key creation.

Done 🎉. you can connect to the VM successfully

If you are geting any error related to the file permission.

You can just run sudo chmode 600 <path-to-your-private-key-dir>/key-name

Conclusion

Now you can to connect Google Cloud VM using SSH on your machine. I hope this helps you.

Related Articles

More insights from our engineering team

Say Hello to Vite+: The One Tool That Just Makes Sense
Web Development
May 9, 2026

Say Hello to Vite+: The One Tool That Just Makes Sense

If you’ve been building web apps for a while, you know the struggle. You start a project with Vite because it’s blazing fast… then suddenly you’re wiring up Vitest for tests, ESLint for linting, Prettier for formatting, and a bunch of other tools just to keep things running smoothly.

How Kali Linux Helps Protect Your Web Applications, eCommerce Stores, and API
Cybersecurity
May 7, 2026

How Kali Linux Helps Protect Your Web Applications, eCommerce Stores, and API

Running a website, online store, or API is exciting, but it also comes with security risks. Hackers are always looking for weak points to steal data, damage websites, or interrupt services. This is why businesses need strong security tools to stay protected.

Why We Don’t Use WordPress for Our Clients
Business
May 3, 2026

Why We Don’t Use WordPress for Our Clients

At Finepher, one of the most common questions we get is: “Why don’t you just build our website on WordPress?”