Reputation: 3470
I have been trying to ssh from one google cloud instance to another. I am able to SSH from my local machine which the host OS is windows and the VM OS which is Ubuntu.
I am running the commands straight from the website.
1.
me@local:~$ eval `ssh-agent`
2.
me@local:~$ ssh-add ~/.ssh/google_compute_engine
3.
gcloud compute ssh --ssh-flag="-A" INSTANCE
The error I am getting is
ERROR: (gcloud.compute) Invalid choice: 'ssh-flag=-A'.
Everything I see on internet is how to SSH into the VM but not how to SSH from one VM to another.
Upvotes: 2
Views: 3474
Reputation: 643
From your first instance do:
gcloud auth login
and you will be given a link, paste that into your browser, then login with the account of your second instance.
You will then get a key paste that in your first instance terminal.
Upvotes: 1
Reputation: 21384
I can still do this, with gcloud
version 97.0.0:
> gcloud compute ssh --ssh-flag="-A" --zone=us-central1-f user@ssh-test
Warning: Permanently added '104.197.77.90' (ECDSA) to the list of known hosts.
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
user@ssh-test:~$
Are you sure the command in #3 is copied correctly?
Upvotes: 4