ssh - Google Cloud SSH 从一个实例到另一个实例

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

我一直在尝试从一个谷歌云实例 ssh 到另一个实例。我可以从主机操作系统为 Windows 的本地计算机和 VM 操作系统为 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 从一个虚拟机到另一个虚拟机。

最佳答案

我仍然可以使用 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中的命令复制正确吗?

关于ssh - Google Cloud SSH 从一个实例到另一个实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35593015/

相关文章:

python-3.x - 即使使用 load_system_host_keys + WarningPolicy,Paramiko 也无法打开 ssh 连接

linux - Compute Engine Linux 用户及其与服务帐号的关系

计算引擎上的 google cloudML 的 Docker 容器 - 验证安装桶

google-cloud-platform - Google Cloud 函数和服务帐户

google-cloud-platform - GCP IAM : Binding role to Service Account fails

node.js - 使用 App Engine Node JS 标准的过滤器进行云数据存储投影查询

python - 连接到hadoop数据库表

linux - SSH 命令在 Expect 脚本中的行为有所不同

ssh - 在 PuTTY 中启动 SSH 连接,运行命令,并保持 session 处于事件状态

google-compute-engine - 无法配置 Google Cloud Pub/Sub 推送订阅者