使用scp2 nodeJs时连接超时。

时间:2015-09-16 18:08:28

标签: javascript node.js

我正在运行以下代码:

var sendFile = function(){
console.log("sending file to the server")
client.scp(configs.fileName, {
    host: configs.hostName,
    username: configs.userName,
    port : 22,
    password: configs.passWord,
    path: configs.seam_dir,
passphrase: configs.ssh_passphrase,
privateKey: require('fs').readFileSync(configs.ssh_key_filePath)
}, function(err) {
    console.log(err);
})
}

这将给出错误:

{ [Error: Timed out while waiting for handshake] level: 'connection-timeout' }

注意:配置是我拥有所有价值的地方。

0 个答案:

没有答案