Incapio - Blog Posts © 2022 by Incapio is licensed under CC BY-SA 4.0 

How to SSH into Google Cloud VM Instance via ZOC | Compute Engine

Updated: Jan 28

Prerequisites:

You will need the following items to complete this tutorial

  1. A Compute Engine VM instance Up and Running with Linux.

  2. ZOC • SSH Client and Terminal Emulator

  3. RSA2 Public and Private key files.

What is ZOC Terminal?.

ZOC is a Windows and macOS terminal emulation program.

Its long list of emulations and sophisticated capabilities make it a dependable and elegant tool for connecting to hosts and mainframes through the secure shell, telnet, serial cable, and other communication methods. For example, SSH Client Zoc is a program that allows you to connect to a server using SSH.


What exactly is SSH?

SSH is a protocol for encrypting and transporting data over an insecure network. Its major goal is to set up an encrypted communication channel with a remote shell account. ZOC Terminal is software that allows you to connect to a distant server from your local computer. It allows you to input commands and views the outcome of those instructions on the other computer after you've connected.


To learn more about the ZOC SSH client and its features. Visit the link here.

To download the ZOC client. Kindly go through the URL below.

https://www.emtec.com/download.html

Step - 1: How to add an SSH public key to Google Compute Engine VM Instance.

Compute Engine supports several methods to add a public SSH key to Compute Engine VM instances.

To access all VMs in a project, you can utilize SSH keys included in project metadata. In addition, individual VMs can be accessed using SSH keys included in instance metadata.


How to generate SSH key pair?.

At first, Generate a public and private key using the ZOC terminal. To generate keys, Open the ZOC terminal and navigate to the "Tools" menu and click on the "SSH Public/Private Key Generator" option.

ZOC, RSA2, comment, passphrase, private key, create public and private key
ZOC - Create Key Pair Interface
  1. In the SSH Create Keyfile window, choose the "Type/Mode" to the "RSA2 Public/Private key files" option.

  2. In the Key Length input field, specify the "2048" bit.

  3. In the Comment input field, type the name—for instance, a username(manoj) used for logging into the VM instances.

  4. Type your key password or default it to empty in the Passphrase and Confirm Passphrase input fields.

  5. In the Private Key field input field, specify the directory path where you prefer to store public and private keys.

  6. Finally, Click on the "Create Public/Private key files." option to generate keys.

Method - 1: How to Add SSH keys to project metadata?.

Navigate to the directory in which the ZOC terminal stores the key pair and open the public key in any text editor. Lastly, copy the content in the key.

GCP, Compute Engine, Metadata, SSH keys, edit, add item, pub, public key
Google Cloud VM Metadata Interface

To add the public key to the project metadata:

  1. Navigate to Compute Engine Metadata interface and click on the "SSH KEYS" tab.

  2. Click on the "Edit" option to append your public key file.

  3. Click on the "Add Item" option, paste the public key code in the input field, and save it.

Method - 2: How to Add SSH keys to VM instance metadata?.

Navigate to Compute Engine VM Instance interface and click on the "Create Instance" Option to deploy a new instance.

GCE, SSH Keys, add SSH public key, add item, security, SSH keys,
Compute Engine VM Metadata Interface

To add SSH keys to VM instance metadata:

  1. Click on the "Add Item" option under the SSH Key in the Security section.

  2. Finally, click on the "Create" option to deploy a VM instance with your public key.

Step - 2: Connect to Google's Compute Engine VM Instances via SSH?.

Navigate to Compute Engine VM instance interface and copy VM instance external IP address which you prefer to connect through SSH.

ZOC, SSH Client, IP, emulation, username, password, SSH key, Private key, connect
ZOC Quick Connection Interface
  1. Open the ZOC client, and click on the "Quick Connection" option.

  2. Paste the VM Instance external IP address in the "Connect to" input field in the quick connection window.

  3. In the username input field, type the username(The name that is entered earlier in the comment field).

  4. Click on the "select key" button in the SSH key field and select the "OpenSSH Private key file" option.

  5. Lastly, select the private key created earlier using the ZOC terminal.

  6. Note: Select the correct private key if you wish to connect the VM instance using an SSH key included in the project metadata. In another situation, if you choose to connect the VM instance with a VM individual key, pick the appropriate individual private key.

  7. Finally, click on the "Connect" option.

ZOC terminal, success, login, root access
ZOC + Google Shell Access

Conclusion:

Here are some recommended tips and tricks.

To learn more about other third-party tools. Visit the link below.

https://cloud.google.com/compute/docs/instances/connecting-advanced#windows-putty





252 views0 comments

Do you need assistance? Visit Forum to join the conversation.