SSH Into Google Compute Engine

Permission denied (publickey)

gcloud

gcloud compute ssh INSTANCE_NAME

If you have same INSTANCE_NAME across different zone, or multiple projects.

gcloud compute ssh --project=PROJECT_ID --zone=ZONE INSTANCE_NAME

If your local machine username differ from Compute VM Instance's username, you will get Permission denied (publickey) (the username is usually extracted from your email/gmail account). Or you could create a local username which is same as the VM instance username.

NOTE: If you are unsure of the username of the VM instance

gcloud compute ssh USERNAME@INSTANCE_NAME

Browser

Goto https://console.cloud.google.com/compute/instances

Select your instance and click SSH.

NOTE: Use CTRL-SHIFT-C/V for copy and paste.

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.