我正在尝试使用“ssh2”模块连接到 ssh 服务器,但服务器密码与 ssh2 流密码上的任何 chiper 都不匹配。 这是 ssh session 日志:
+LiveParser:DEBUG: Outgoing: Writing DISCONNECT (KEY_EXCHANGE_FAILED)
+LiveParser:DEBUG: No matching Client->Server cipher
+LiveParser:DEBUG: (remote) Client->Server ciphers: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
+LiveParser:DEBUG: (local) Client->Server ciphers: aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm,aes128-gcm@openssh.com,aes256-gcm,aes256-gcm@openssh.com
如何将这些密码添加到我的应用程序中??
最佳答案
documentation for connect()
显示所有可能的连接选项。其中之一(ssh2
v0.5 中的新功能)是 algorithms
选项。您可以像这样显式设置要在算法协商期间使用的密码列表:
conn.connect({
// ...
algorithms: {
cipher: [
'aes128-ctr',
'aes192-ctr',
'aes256-ctr',
'aes128-gcm',
'aes128-gcm@openssh.com',
'aes256-gcm',
'aes256-gcm@openssh.com',
'aes256-cbc'
]
}
});
关于javascript - 将新密码添加到 ssh2-stream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38679325/