Closed ltinerary closed 3 years ago
Hello! Thanks for the detailed post.
I think one misunderstanding here might be that isConnected
means it is in fact connected, It's a misleading name and what it actually means is isConnectingOrConnected
instead. I think you should try storing the connection promise somewhere and awaiting on it before trying to execute a command.
It's also entirely possible that my speculation is false, my knowledge in the underlying works of ssh2 is very limited. Please consult with the excellent mscdex over at https://github.com/mscdex/ssh2 for an indepth conversation
Thank you
Thanks very much!!!
I think one misunderstanding here might be that isConnected means it is in fact connected, It's a misleading name and what it actually means is isConnectingOrConnected instead. I think you should try storing the connection promise somewhere and awaiting on it before trying to execute a command.
you were right!
I always thought it was the SSH configuration and never realized I had a bug with my code.
Thank you for taking the time to reply!
I had a host A,the info of host A was:
node-ssh
server [the node-ssh version is 12.0.1]OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
here is host B‘s info:
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
Sometimes,we can conected host B through host A, But Sometimes we can't.
When failed, we have not received any information of failure through
node-ssh
, But,in host B,we founddispatch_protocol_error: type 90 seq 5 [preauth]
error in ssh's log file.we tried set up an SSH connection directly in host A by
ssh user@hostB
, Repeated attempts,this error didn't appear . So we wondered if it was the problem of thenode-ssh
? But we don't know for sure. So I opened this issue for help.Thank s lot.
Here was the code for a major SSH service in HostA: