javascript - 将新密码添加到 ssh2-stream

标签 javascript node.js encryption ssh

我正在尝试使用“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/

相关文章:

javascript - AngularJs:是否可以从外部将值传递给 Controller ​​或指令?

javascript - 传递给 JavaScript 函数的参数数量是否需要与函数中定义的数量相同

security - 我们能否加密必须使用任何私钥加上服务器解密的数据才能生成位?

android - 使用集成 Android 2.3 SIP 堆栈进行加密 VoIP 通信

javascript - 带有ajax加载多页的JQuery mobile + Phonegap

javascript - javascript中对象内部的setInterval

node.js - 如何将 jwt token 从一个路由传递到另一个路由

javascript - 如何将两条不同的路由映射到同一个路由器

Java - AES CBC 算法生成 SecretKeySpec 的不同方式

javascript - RequireJS 模块中的自引用