Subject: Re: How should my libssh2-based client handle gratuitous keepalives from the ssh server?

Re: How should my libssh2-based client handle gratuitous keepalives from the ssh server?

From: Jeremy Friesner <jeremyf_at_meyersound.com>
Date: Mon, 22 Jan 2018 18:50:19 +0000

Hi Peter,

Thanks for the information.

For the record, I worked around the problem by adding code such that when my libssh socket starts select()-ing as read-for-read during what should be an idle period, my program responds by setting up a command channel and sending a dummy ssh command (e.g. “echo hello”) to the server. That appears to be sufficient to cause libssh2 to aborb the received keepalive-ping-data and to keep the sshd server happy that my client is still alive.

-Jeremy

> On Jan 19, 2018, at 4:45 PM, Peter Stuge <peter_at_stuge.se> wrote:
>
> Jeremy Friesner wrote:
>> ClientAliveInterval 15
> ..
>> Is there a recommended way to handle this issue?
>
> No. I don't think libssh2 supports dealing with packet when idle at all.
>
> The real solution is to add a generic protocol handler function, which
> will need a fair bit of work, but I think not a lot of rework.
>
>
> //Peter
> _______________________________________________
> libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2018-01-22