2014-12-04 74 views
0

我想转发流量与谷歌实例,但没有运气。 下面是这种情况: 我有2个实例当前主服务器和小型服务器1 我想从主服务器ssh登录小型服务器-1和创造像这样一个动态端口转发:Ssh端口转发谷歌计算引擎

gcloud compute ssh "mini-server-1" --zone="us-central1-f" --ssh-flag="-D:5551" --ssh-flag="-N" --ssh-flag="-n" &

我有这样的错误:

bind: Cannot assign requested address

我想:ssh -N [email protected](all ips internal external, hostname) -D 5551 &

当我运行netstat我可以看到,港口都是免费的。 这里是wget的使用代理从主服务器

wget google.com -e use_proxy=yes -e http_proxy=127.0.0.1:5551

Connecting to 127.0.0.1:5551... connected.
Proxy request sent, awaiting response...

是否有人知道我能做到这一点?

+0

PS。阿洛斯我修改了sshd_config并添加了AllowTcpForwarding是的,但仍然是相同的结果 – user3057678 2014-12-04 12:36:30

+0

如果你使用http_proxy将不会连接,在wget命令中使用https_proxy进行测试 – Marilu 2014-12-05 01:01:17

回答

1

运行命令与调试标志,以帮助您找到更多的信息:

gcloud compute ssh --ssh-flag=-vvv "mini-server-1" --zone="us-central1-f" --ssh-flag="-D:5551" --ssh-flag="-N" --ssh-flag="-n" & 

,并在之前我的评论提到,使用https_proxy。

+1

是的,这个工程,显然它绑定到ipv6所以我添加了--ssh-flag = “ - 4”。并且还使用标准的ssh如ssh -o StrictHostKeyChecking = no -o ServerAliveInterval = 5 -o ServerAliveCountMax = 100000,只需添加--ssh-flag =“ServerAliveCountMax = 100000”? – user3057678 2014-12-09 15:01:07