尝试连接时出现此错误... SSH - 连接错误:错误:等待握手时超时 尝试连接时出现此错误... SSH - 连接错误:错误:等待握手时超时
这是我的代码
var Client = require ('ssh2'). Client;
var conn = new Client ();
conn.on ('error', function (err) {
console.log ('SSH - Connection Error:' + err);
});
conn.on ('end', function () {
console.log ('SSH - Connection Closed');
});
conn.on ('ready', function () {
console.log ("------ enter ------");
// code to work with SSH
});
conn.connect ({
host: 'host',
port: 22, // Normal is 22 port
username: 'user',
password: 'pass',
});