Re: Keep alive the session after remote execution of the commands
- Subject: Re: Keep alive the session after remote execution of the commands
- From: Javad Rahimi <javad321javad@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Fri, 1 Jul 2022 11:51:15 +0430
- To: Andreas Schneider <asn@xxxxxxxxxxxxxx>
- Cc: libssh@xxxxxxxxxx
Thank you very much
I will test it .
On Fri, Jul 1, 2022, 11:20 Andreas Schneider <asn@xxxxxxxxxxxxxx> wrote:
> On Thursday, June 30, 2022 10:42:59 AM CEST Javad Rahimi wrote:
> > Hello,
> > We have developed a simple ssh client application based on this
> > <https://api.libssh.org/stable/libssh_tutor_command.html> example
> > Chapter 4) to run a command remotely and return the results. However, the
> > ssh server disconnects the connection after executing the command and
> > returning the result.
> > However, it doesn't happen for all SSH servers.
> > Is there any way to force the ssh server to keep alive the session after
> > executing
> It is normal that the session gets closed after an exec request (see the
> If you don't want that use a non-interactive shell ...
> There is no example, but you could improve the docs once you get it
> You need to use ssh_channel_request_shell() and you need some protocol to
> out if your command was successful or not like:
> ./mytool && echo SSH_OK || echo SSH_KO
> I hope this helps :-)
> Andreas Schneider asn@xxxxxxxxxxxxxx
> GPG-ID: 8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
Archive administrator: email@example.com