DEV Community

Cover image for Google Cloud Shell: Establishing Secure Connections via SSH
M. Oly Mahmud
M. Oly Mahmud

Posted on

2

Google Cloud Shell: Establishing Secure Connections via SSH

If you are a Software Engineer or a DevOps Engineer, working on a low-config computer, you might face problems while working with resource-intensive tasks such as learning Kubernetes. Here's a solution that can help you.

What is Google Cloud Shell

Google Cloud Shell is a service from Google Cloud Platform (GCP). It offers a remote computer where you can perform the development tasks. It is a free service for Google users.
What it offers:

CPU:

  • Processor: Intel Xeon.
  • Cores: 2 virtual CPUs.
  • Clock Speed: 2.2 GHz.

Memory (RAM): 8 GB

Host: Google Compute Engine virtual machine.

Operating System: Ubuntu Linux LTS

Included Packages:

  • Docker
  • Kubernetes (kind, minikube)
  • Google Cloud CLI
  • Git and GitHub CLI
  • Go Programming Language
  • Java
  • C# and .NET
  • Node.js
  • Python

Let's get started

We can access Cloud Shell via the Google Cloud Website. You don't need a credit card to use Cloud Shell. Go to the Google Cloud Console on https://console.cloud.google.com/.

Image description

Then, activate Cloud Shell. You need to authorize Cloud Shell by clicking the Authorize button.

Image description

You will see an interface like this:

Image description

However, we will use Google Cloud CLI.

Install the Google Cloud CLI

Go to this link https://cloud.google.com/sdk/docs/install to install the tool according to your Operating System.

Verify the installation by running the following command in the terminal:

gcloud version
Enter fullscreen mode Exit fullscreen mode

You will see something like this:

Image description

Sign in to Google Cloud

Log in to Google Cloud by running the following command.

gcloud auth login
Enter fullscreen mode Exit fullscreen mode

A browser window will open. Log in to your Google account. After successful login, you can close the browser window. Now, go back to the terminal again.

Access Cloud Shell via SSH

Run the following command to access your Google Cloud Shell.

gcloud cloud-shell ssh 
Enter fullscreen mode Exit fullscreen mode

This will generate private and public SSH keys and establish an SSH connection to the Cloud Shell.

Now, you can access the dev environment.

If you want to see the equivalent command that is behind the gcloud cloud-shell ssh command, run the following command.

gcloud cloud-shell ssh --dry-run
Enter fullscreen mode Exit fullscreen mode

You will see the equivalent command to access the Cloud Shell without the Google Cloud CLI.

Image description

Conclusion

Google Cloud Shell is a handy, free tool for those who are learning development and DevOps. Especially, can use it to learn and practice Kubernetes.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay