I am in the exact same situation as the person who posted another question, I am trying to tunnel ssh connections through a gateway server instead of having to ssh into the gateway and manually ssh again to the destination server from there. I am trying to set up the solution given in the accepted answer there, a ~/.ssh/config
that includes:
host foo
User webby
ProxyCommand ssh a nc -w 3 %h %p
host a
User johndoe
However, when I try to ssh foo
, my connection stays alive for 3 seconds and then dies with a Write failed: Broken pipe
error. Removing the -w 3
option solves the problem. What is the purpose of that -w 3
in the original solution, and why is it causing a Broken pipe
error when I use it? What is the harm in omitting it?
It avoids leaving orphaned
nc
processes running on the remote host when thessh
session is closed improperly.Try increasing the timeout for
nc
to 90 and settingServerAliveInterval
to 30 to see if your problem go away: