gcloud compute ssh INSTANCE_NAME
If you have same INSTANCE_NAME across different zone, or multiple projects.
gcloud compute ssh --project=PROJECT_ID --zone=ZONE INSTANCE_NAME
If your local machine username differ from Compute VM Instance's username, you will get
Permission denied (publickey) (the username is usually extracted from your email/gmail account). Or you could create a local username which is same as the VM instance username.
NOTE: If you are unsure of the username of the VM instance
gcloud compute ssh [email protected]_NAME
Select your instance and click SSH.
CTRL-SHIFT-C/V for copy and paste.