[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SSH channel forwarding fails on ieof


-Are you using nonblocking sessions?
No, it didn't work for me at all.

-Are you sure the ssh_channel_open_session returns SSH_OK every time ?
I use channel_open_forward and it returns SSH_OK every time for sure

-Do you check all error codes from libssh ?
If it returns error code - yes

-Please increase the verbosity level as we cannot see all that is done here.
I attached log but after update to 0.6 error about refusing connection disappeared but it still doesn't work.

Here what I'm trying to do:
XenServer listens only to local connections. I try to make some kind of proxy for another process (VNC widget) that connects to local socket. libssh is to transfer packets from local socket to ssh channel
Source code is attached. Sorry I'm not a pro so it may be a bad solution.
It still works perfectly for old XenServer...



On 09/25/2013 03:45 PM, Aris Adamantiadis wrote:
Hi,

I will need some source code samples to debug this. Quick questions:
-Are you using nonblocking sessions ?
-Are you sure the ssh_channel_open_session returns SSH_OK every time ?
-Do you check all error codes from libssh ?
-Please increase the verbosity level as we cannot see all that is done here.

Thanks,

Aris

Le 25/09/13 13:37, Pugnator a écrit :
It's a pity but it seems I was in hurry. The issue is still reproducing
on some machines.
The error code is the same

channel_by_id: 0: bad id: channel free

But issue is not stable - reproduces on specific machines only


On 09/25/2013 04:27 AM, Pugnator wrote:
Thanks a lot for your reply.
Yes, it is the case for me as I'm creating multiple channels
simultaneously.
I used stable repo from Debian 7. I followed your suggestion and
compiled 0.6rc.
The issue was not reproduced after it.


On 09/25/2013 12:36 AM, Aris Adamantiadis wrote:
Hi,

Could you try again with libssh 0.5.5 or 0.6rc and tell me if you can
reproduce the problem ? This behaviour recalls me of a bug that has been
fixed in 0.5.3, and would happen when you open multiple channels. Is it
the case ?

Thanks,

Aris

Le 24/09/13 18:21, Pugnator a écrit :
I use libssh 0.5.2 binding for C under Linux. In my program I create
SSH
tunnel to XenServer. It worked perfectly until I updated to the most
recent XenServer 6.2. After it ssh tunneling started failing with

[1] Analyzing banner: SSH-2.0-OpenSSH_4.3
[1] We are talking to an OpenSSH client version: 4.3 (40300)
[1] placing 18 bytes into channel buffer (stderr=0)
[1] Error : Channel opening failure: channel 44 error (2) Connection
refused

On server side there is records in /var/log/secure:

Sep 24 20:12:10 proxima sshd[20782]: pam_unix(sshd:session): session
opened for user root by (uid=0)
Sep 24 20:12:10 proxima sshd[20792]: Accepted password for root from
10.250.144.221 port 55673 ssh2
Sep 24 20:12:10 proxima sshd[20792]: pam_unix(sshd:session): session
opened for user root by (uid=0)
Sep 24 20:12:11 proxima sshd[16132]: channel_by_id: 0: bad id:
channel free
Sep 24 20:12:11 proxima sshd[16132]: Disconnecting: Received ieof for
nonexistent channel 0.
Sep 24 20:12:11 proxima sshd[16132]: pam_unix(sshd:session): session
closed for user root


The most strange is the ssh server version is the same on old and new
servers:
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

I'm not sure how to debug such an issue. Sometimes tunnel establishes
and works but it is 1 out of 100 tries.




Attachment: source_logs.tar.gz
Description: GNU Zip compressed data


References:
Dropbear support?Adrian Baerlocher <adrian@xxxxxxxxxxxx>
Re: Dropbear support?Andreas Schneider <asn@xxxxxxxxxxxxxx>
Re: Dropbear support?Adrian Baerlocher <adrian@xxxxxxxxxxxx>
SSH channel forwarding fails on ieofPugnator <ookami@xxxxxxx>
Re: SSH channel forwarding fails on ieofAris Adamantiadis <aris@xxxxxxxxxxxx>
Re: SSH channel forwarding fails on ieofPugnator <ookami@xxxxxxx>
Re: SSH channel forwarding fails on ieofPugnator <ookami@xxxxxxx>
Re: SSH channel forwarding fails on ieofAris Adamantiadis <aris@xxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org