您好,我有一个小问题,我使用节点 js 开发了一个脚本 sftp 客户端,它连接到 sftp 服务器并获取一些文件,我用我的本地服务器对其工作进行了测试,但是当我尝试将它与生产服务器一起使用时,我收到了这个错误 :
错误:握手失败:没有匹配的密钥交换算法
我已经使用生成了 rsa 密钥ssh-keygen
这是脚本的相关部分:
var Client = require('ssh2').Client;
var fs = require('fs');
var path = require('path');
var args = process.argv.slice(2);
var connSettings = {
host: args[0] || '127.0.0.1',
port: args[1] || 22,
username: args[2] || 'karim',
password: args[3] || 'karimos',
algorithms: {
hmac: ['hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1', 'hmac-sha1-96']
}
};