steelbrain / steelbrain/node-ssh

Undesired timeout right after streaming command ends

Open
#392 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with NodeSSH.connect and ssh.exec, including readyTimeout and the onStdout callback. Trace how command completion and timeout output are handled; done means a completed streaming command no longer prints an unexpected TIMEOUT.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.