2014-12-04 76 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