hands-on lab

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

Difficulty: Beginner
Duration: Up to 45 minutes
Students: 2,935
Rating: 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.

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

July 2nd, 2024 - Updated lab to use CentOS Stream 9

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

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