Search code examples
sshgoogle-compute-enginegcloudgcloud-cli

gcloud ssh stack at authentication, plus incorrect name


I am trying to login to my VM on google cloud using the following command (on Win 7):

gcloud compute ssh --zone=<zone_name> --ssh-flag="-D" --ssh-flag="1080" --ssh-flag="-N" <host_name>

It opens Putty windows with the following info:

Using username "some.local.name".
Authenticating with public key "SOMEDOMAIN\some.local.name@localhostname"

And does not move beyond this screen. It looks like it is using my local machine name and username instead relevant to google cloud. I wonder how I can fix it?

Also what are these flags --ssh-flag="-D" and -ssh-flag="-N". I cannot find explanation anywhere.


Solution

  • According to https://cloud.google.com/sdk/gcloud/reference/compute/ssh, --ssh-flag passing the argument directly into PuTTY. You can look at PuTTY's help to see what -D and -N mean.

    Does doing just gcloud compute ssh <host_name> work? I am assume by <host_name> you mean the Google Cloud Compute VM instance name.