node-ssh icon indicating copy to clipboard operation
node-ssh copied to clipboard

Undesired timeout right after streaming command ends

Open killjoy2013 opened this issue 4 years ago • 0 comments

Hi, Trying to use node-ssh in our project. Looks like it's exactly what we need, thanks for your effort! My code is below.

  const ssh = new NodeSSH();

  ssh
    .connect({
      host: ip,
      port: port,
      username: username,
      password: password,
      readyTimeout: 99999,
      
    })
    .then(() => {
      ssh.exec(myCommand, [], {
        onStdout(chunk) {
          console.log(chunk.toString('utf8'));
        }
      });
    });

It displays output chunks in streaming manner. However, right after command finishes, it prints,

TIMEOUT
Bye...

Should I set a timeout for the ssh session? How?

Regards

killjoy2013 avatar Jul 04 '21 05:07 killjoy2013