【问题标题】:Google Cloud SSh from one instance to another从一个实例到另一个实例的 Google Cloud SSH
【发布时间】:2016-06-06 04:53:04
【问题描述】:

我一直在尝试从一个谷歌云实例 ssh 到另一个。我可以从主机操作系统为 windows 和虚拟机操作系统为 Ubuntu 的本地计算机进行 SSH。

我直接从网站运行命令。

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 连接到虚拟机,而不是如何通过 SSH 从一个虚拟机连接到另一个虚拟机。

【问题讨论】:

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


【解决方案1】:

我仍然可以这样做,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 中的命令复制正确吗?

【讨论】:

  • 成功了,先生。我得到的那个错误有点误导,我需要更改该语句的不同部分而不是“A”标志。谢谢!
  • 它有效,但我仍然无法从一个实例 ssh 到另一个实例。我收到“权限被拒绝(公钥)”
  • 检查您尝试通过 SSH 连接的实例的串行端口输出。
  • 我不能菊花链 ssh 但我想没关系,我不应该需要
【解决方案2】:

从你的第一个实例做:

gcloud auth login

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

【讨论】:

    猜你喜欢
    • 2018-04-18
    • 2014-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-10
    • 2020-05-19
    相关资源
    最近更新 更多