hands-on lab

Connect to Google Compute Engine (GCE) Linux VM Instances Using SSH

Beginner
Up to 45m
2,864
4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

Lab Overview

Google Compute Engine (GCE) is a high-performance and scalable service that allows you to deploy virtual machines in the cloud. No matter how big your project is, Compute Engine automatically scales from one instance to thousands with the help of load-balancers. Compute Engine's VM instances boot quickly, come with persistent disk storage, and deliver consistent performance. Compute Engine also offers you discounts. The more compute resources you use, the more the discount that will be applied to your account billing.

This lab will show you two methods for connecting to Linux VM instances over SSH. The first method uses SSH keys managed by Google and is established completely within your web browser. The second method involves creating a custom SSH key pair (public and private key) and attaching the public key to the VM in the Google Cloud environment.

Learning Objectives

Upon completion of this lab you will be able to:

  • Connect to Linux VM instances by using a browser-based SSH connection (SSH from the Browser)
  • Generating/uploading a custom SSH key for instances
  • Connect to Linux instances by using custom SSH keys

Intended Audience

This lab is intended for:

  • Google Cloud Associate Cloud Engineer (ACE) certification candidates
  • Individuals that are new to Google Cloud or Google Compute Engine (GCE) and want to learn more about how to interact with a Linux instance
  • GCP users interested in using self-managed SSH keys

Prerequisites

This lab has no prerequisites.

Updates

January 27th, 2023 - Resolved SSH key issue

March 28th, 2022 - Updated instance image

January 27th, 2022 - Updated the instructions and screenshots to reflect the latest UI

February 14th, 2021 - Clarified instructions for generating an SSH key with no passphrase

Environment before

Environment after

About the author
Students
40,438
Labs
106
Courses
2
Learning paths
10

Stefano studies Computer Science and is passionate about technology. He loves working with Cloud services and learning all the best practices for them. Google Cloud Platform and Amazon Web Services are the cloud providers he prefers. He is a Google Cloud Certified Associate Cloud Engineer. Node.js is the programming language he always uses to code. When he's not involved in studying or working, Stefano loves riding his motorbike and exploring new places.

Covered topics
Lab steps
Signing In to the Google Cloud Console
Generating SSH Keys for the Virtual Machine
Attaching the Public Key to the VM Instance
Connecting to the VM Instance Using the Custom SSH Key