steelbrain / node-ssh

SSH2 with Promises
MIT License
947 stars 94 forks source link

feature suggestions #468

Closed zydingjun closed 1 year ago

zydingjun commented 1 year ago

1# add function ssh.close() to close the SSH session; 2# add ConnectTimeout limit for configure;

steelbrain commented 1 year ago

Hi @zydingjun!

Thanks for writing in. For closing the ssh connection, you can just call ssh.dispose()

The timeout is an already supported option, please see readyTimeout in ssh2 config. You can use it with node-ssh in .connect() so it would look like ssh.connect({ ... , readyTimeout: 20000})

Closing this issue as the question has been answered but feel free to continue discussing.