通过GCE设置SSH隧道

问题描述 投票:0回答:1

我按照这里的指示https:/cloud.google.comcommunitytutorialssh-tunnel-on-gce。来设置通过计算引擎的SSH隧道。我使用这个命令创建了一个计算实例,这很好,然后我试着在本地端口5000和SSH端口22的机器上运行这个命令来启动一个SSH隧道。

gcloud compute instances create --zone us-west1-a tunnel 

然后我试着在本地端口5000和SSH端口22的机器上运行这个命令来启动SSH隧道。

gcloud compute ssh --zone us-west1-a tunnel -- -N -p 22 -D localhost:5000

得到以下错误信息

enter image description here

ssh google-cloud-platform google-compute-engine ssh-tunnel
1个回答
3
投票

你使用的命令在Windows上不起作用,只有Linux上才起作用。CLI gcloud在Windows上启动putty.exe。查看putty文档中的等效命令行选项,直接启动putty.exe而不是CLI。对于Windows,我建议使用Windows版本的ssh.exe(OpenSSH)来代替。

安装OpenSSH For Windows Server 2019和Windows 10。

© www.soinside.com 2019 - 2024. All rights reserved.