openssh-unix-dev October 2011 archive
Main Archive Page > Month Archives  > openssh-unix-dev archives
openssh-unix-dev: Creating a reverse socket often (not always) f

Creating a reverse socket often (not always) fails.

From: Krzysztof Stankiewicz <krzysztof_stankiewicz_at_nospam>
Date: Sat Oct 22 2011 - 03:39:30 GMT
To: <openssh-unix-dev@mindrot.org>

Hi,

I'm a little stuck on getting reverse connection working reliably from embedded devices running dropbear 0.51 to Ubuntu 8.x openssh.
Connecting to local reverse socket often fails (not always) with "ssh_exchange_identification: Connection closed by remote host"

My devices can reverse ssh and open a port on my server always, but often when the server is creating the reverse socket on localhost it
freezes at "debug2: channel 2: sent ext data 706". The reverse connection works but later connecting to that reverse socket on the server
fails with "ssh_exchange_identification: Connection closed by remote host".

"often fails" means for a time it will allow connections and then same configuration for a time will fail.

Any help would be very appreciated, Ive traced it down this far and could use some further pointers if possible. Seems an obscure problem at this stage.

Thank you.

//creating reverse connection, creates a socket but subsequently conecting to it fails.
debug1: channel 1: new [port listener]
debug1: server_input_channel_open: ctype session rchan 0 win 24576 max 32768
debug1: input_session_request
debug1: channel 2: new [server-session]
debug1: session_new: init
debug1: session_new: session 0
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 2 request shell reply 0
debug1: session_by_channel: session 0 channel 2
debug1: session_input_channel_req: session 0 req shell
debug2: fd 3 setting TCP_NODELAY
debug2: fd 11 setting O_NONBLOCK
debug3: fd 11 is O_NONBLOCK
debug2: fd 13 setting O_NONBLOCK
debug2: channel 2: read 702 from efd 13
debug2: channel 2: rwin 24540 elen 702 euse 1
debug2: channel 2: sent ext data 702
------freezes here even though reverse connection is fine.

//creating a good reverse connection, can connect to this local socket without a problem.
debug1: channel 1: new [port listener]
debug1: server_input_channel_open: ctype session rchan 0 win 24576 max 32768
debug1: input_session_request
debug1: channel 2: new [server-session]
debug1: session_new: init
debug1: session_new: session 0
debug1: session_open: channel 2
debug1: session_open: session 0: link with channel 2
debug1: server_input_channel_open: confirm session
debug1: server_input_channel_req: channel 2 request shell reply 0
debug1: session_by_channel: session 0 channel 2
debug1: session_input_channel_req: session 0 req shell
debug2: fd 3 setting TCP_NODELAY
debug2: fd 11 setting O_NONBLOCK
debug3: fd 11 is O_NONBLOCK
debug2: fd 13 setting O_NONBLOCK
debug2: channel 2: read 706 from efd 13
debug2: channel 2: rwin 24540 elen 706 euse 1
debug2: channel 2: sent ext data 706
debug2: channel 2: rcvd eof
debug2: channel 2: output open -> drain
debug2: channel 2: obuf empty
debug2: channel 2: close_write
debug2: channel 2: output drain -> closed
debug2: channel 2: rcvd close
debug2: channel 2: close_read
debug2: channel 2: input open -> closed
debug3: channel 2: will not send data after close
debug2: channel 2: almost dead
debug2: channel 2: gc: notify user
debug1: session_by_channel: session 0 channel 2
debug1: session_close_by_channel: channel 2 child 12289
debug1: session_close_by_channel: channel 2: has child

                                                                                              
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev