Comment 13 for bug 590925

Revision history for this message
Daniel Popowich (danielpopowich) wrote :

I just went through the ringer tracing down a problem with nc on lucid and discovered that the problem is in a major difference between nc.openbsd and nc.traditional. Above, Soren states:

> Both have -w. They do the same.

Well, they don't. Not by a longshot. If you surf the 'net for ssh ProxyCommand usage you will see a lot of suggestions to do this in your ~/.ssh/config file:

   Host foobar
       ProxyCommand ssh mygateway nc -w 1 foobar 22

The above allows one to ssh into host foobar which sits behind a ssh gateway, mygateway. The -w option in nc.traditional is a timeout "on connections and EOFs". Add to that for nc.openbsd, "stdin". In other words, my users are discovering that if they don't send input every second they will be bumped off.

Man page for nc_traditional:

     -w secs timeout for connects and final net reads

Man page for nc (openbsd):

    -w timeout
             If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed.

I installed both netcat-openbsd and netcat-traditional on mygateway. I put this in my ~/.ssh/config file on a remote computer:

    Host foobar
       ProxyCommand ssh mygateway nc.openbsd -w 1 foobar 22

    Host foobar2
       ProxyCommand ssh mygateway nc.traditional -w 1 foobar 22

If I ssh to foobar, I get disconnected after one second of idle time. Foobar2, I stay logged in.

Cheers,

Dan