Google Cloud SSh从一个实例到另一个实例

时间:2016-02-24 04:02:24

标签: ssh google-compute-engine google-cloud-platform private-key gcloud

我一直试图从一个谷歌云实例ssh到另一个。我可以从我的本地机器SSH,主机操作系统是Windows和VM操作系统是Ubuntu。

我正在直接从网站上运行命令。

1

me@local:~$ eval `ssh-agent`

2

me@local:~$ ssh-add ~/.ssh/google_compute_engine

3

gcloud compute ssh --ssh-flag="-A" INSTANCE

我得到的错误是

错误:(gcloud.compute)选项无效:' ssh-flag = -A'。

我在互联网上看到的一切都是如何通过SSH连接到虚拟机而不是如何从一个虚拟机连接到另一个虚拟机。

2 个答案:

答案 0 :(得分:3)

我仍然可以使用gcloud版本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:~$

您确定#3中的命令是否已正确复制?

答案 1 :(得分:1)

在您的第一审中执行

gcloud auth login

,您将获得一个链接,将其粘贴到浏览器中,然后使用您的第二实例的帐户登录。
然后,您将获得一个并将其粘贴到您的初审终端中。

相关问题