[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keep alive the session after remote execution of the commands
[Thread Prev] | [Thread Next]
- Subject: Re: Keep alive the session after remote execution of the commands
- From: Jakub Jelen <jjelen@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Fri, 1 Jul 2022 14:13:21 +0200
- To: libssh@xxxxxxxxxx
On 6/30/22 10:42, 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 (libssh: 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
I think this depends on the server configuration. OpenSSH servers by default allow creating more channels/sessions per connection (MaxSessions default is 10 in sshd_config), but if you connect to other SSH implementation or if somebody configured the server not to allow opening more sessions/channels, then this might fail.
Please, review the server configuration, but if the server configuration/implementation does not allow this, there is nothing else you could do. Only run all the commands as part of the shell as mentioned by Andreas previously.
Regards, -- Jakub Jelen Crypto Team, Security Engineering Red Hat, Inc.
Archive administrator: postmaster@lists.cynapses.org