LogoLogo
  • 🤩Welcome!
  • Buffer overflow
    • Remote Buffer Overflow
      • Crashing the Application
      • Controlling the EIP
      • Finding Bad Characters
      • Finding a Return Address
      • Generating Shellcode
      • Getting a Shell
  • Wireless Penetration Testing
    • Wifi Pineapple - Tetra
      • Setup
      • Firmware Upgrade
      • Capturing Wireless Handshake
      • Cracking WPA2 Handshake
      • PineAP
      • Modules
  • PortSwigger Labs
    • Authentication
      • Username enumeration via different responses
      • Username enumeration via subtly different responses
      • Username enumeration via response timing
  • TryHackMe
    • 🎄Advent of Cyber 3 (2021)
      • [Day 1] Save The Gifts
      • [Day 2] Elf HR Problems
      • [Day 3] Christmas Blackout
      • [Day 4] Santa's Running Behind
      • [Day 5] Pesky Elf Forum
      • [Day 6] Patch Management Is Hard
      • [Day 7] Migration Without Security
      • [Day 8] Santa's Bag of Toys
      • [Day 9] Where Is All This Data Going
  • Google Cloud Computing
    • ☁️Cloud Computing Fundamentals
      • Getting Started with Cloud Shell and gcloud
      • Creating a Virtual Machine
      • App Engine: Qwik Start - Python
      • Cloud Functions: Qwik Start - Command Line
      • Kubernetes Engine: Qwik Start
      • Set Up Network and HTTP Load Balancers
Powered by GitBook
On this page
  • Overview
  • Setup
  • Activating Cloud Shell
  • Listing Active Account
  • Listing Project ID
  • Configuring Environment
  • Get Project Information
  • Check Gcloud config
  • Export Environment Variables
  • Creating a VM with Gcloud
  • Installing Components
  • Install and enable
  • Autocomplete Mode
  • SSH into VM (via Gcloud)
  • Initiate an ssh connection

Was this helpful?

  1. Google Cloud Computing
  2. Cloud Computing Fundamentals

Getting Started with Cloud Shell and gcloud

LAB 1

PreviousCloud Computing FundamentalsNextCreating a Virtual Machine

Last updated 3 years ago

Was this helpful?

Overview

Cloud Shell provides you with command-line access to computing resources hosted on Google Cloud. Cloud Shell is a Debian-based virtual machine with a persistent 5-GB home directory, which makes it easy for you to manage your Google Cloud projects and resources. The gcloud command-line tool and other utilities you need are pre-installed in Cloud Shell, which allows you to get up and running quickly.

Setup

Activating Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

Hitting the cloud shell icon on the top right activates it as shown below.

Listing Active Account

gcloud auth list

Listing Project ID

gcloud config list project

Configuring Environment

Get Project Information

gcloud compute project-info describe --project <your_project_ID>

Check Gcloud config

gcloud config list

Export Environment Variables

Project ID

export PROJECT_ID=<your_project_ID>

Region/Zone

export ZONE=<your_zone>
export ZONE=asia-southeast1-a

Creating a VM with Gcloud

gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone $ZONE
  • gcloud compute = Enables user to manage compute resources

  • instances create = Create a new instance in the virtual environment

  • gcelab2 = name of the VM

  • --machine-type = user selected machine type

  • --zone = region and zone user likes the VM to be spawned in

Installing Components

gcloud interactive has auto prompting for commands and flags and displays inline help snippets in the lower section of the pane as the command is typed.

You can use dropdown menus to auto-complete static information, such as command and sub-command names, flag names, and enumerated flag values.

Install and enable

sudo apt-get install google-cloud-sdk
gcloud beta interactive

Autocomplete Mode

We were basically able to use the Gcloud interactive shell together with the autocomplete feature and explanation of commands and grab the brief description of the VM that we had just created as shown below.

SSH into VM (via Gcloud)

Initiate an ssh connection

gcloud compute ssh gcelab2 --zone $ZONE

☁️