mina-sshd icon indicating copy to clipboard operation
mina-sshd copied to clipboard

Configurable timeouts in ClientSession#execRemoteCommand

Open abhakash opened this issue 1 year ago • 0 comments

Description

The executeRemoteCommand API in ClientSession needs a configurable timeouts since the default behavior is to try and run the commands indefinitely (correct me if I am wrong here)

https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/client/session/ClientSession.java#L307-L310

Motivation

We use mina-sshd to execute some scripts on bunch of embedded device. The default behavior in executeRemoteCommand led one of the commands to execute for a long time (upto 20 minutes!) due to a bug in the script in the remote server.

Alternatives considered

Creating a Channel ourselves is an acceptable workaround, but we'd prefer the simplicity of setting a timeout and use this API instead.

Additional context

No response

abhakash avatar Jun 25 '24 16:06 abhakash