Connect to VM Instance using SSHConnect to VM Instance using SSH
There are different ways to connect to the VM instance using SSH.
Method 1: SSH - Open in Browser WindowMethod 1: SSH - Open in Browser Window
Perform the following steps to access SSH - Open in Browser Window.
Log in to the Google Cloud Console.
Search Identity-Aware Proxy in the console.
Note: To enable the Cloud Identity-Aware Proxy API, you must have IAP-secured Tunnel User and Service Usage Admin permissions.
Enable Cloud Identity-Aware Proxy API.
This will enable the SSH button in the row of newly created VM instance.
Go to the VM instances page.
In the row of an instance, select Open in browser window from the SSH drop-down menu.
A new window opens and connects to the VM instance.
Method 2: SSH - Cloud ShellMethod 2: SSH - Cloud Shell
Perform the following steps to access SSH - Cloud Shell.
Log in to the Google Cloud console page.
On the top right corner of the console, click Activate Cloud Shell.
The cloud shell page is displayed.
Run the following command:
- gcloud compute ssh <instance-name> --zone=<zone-name> --project=<project-name>
A confirmation pop-up is displayed to Authorize Cloud Shell.
This will connect to the VM instance through SSH.