我一直在尝试从一个谷歌云实例 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/