1

I am using remote-exec which uses the ssh2 npm package and I am getting the following error

Error: Timed out while waiting for handshake

The code which I am running is the following

var rexec = require('remote-exec');

// see documentation for the ssh2 npm package for a list of all options
var connection_options = {
    port: 22,
    username: 'username',
    passphrase: 'password'
};

var hosts = [
    '10.101.10.101'
];

var cmds = [
    'ls -l'
];

rexec(hosts, cmds, connection_options, function(err){
    if (err) {
        console.log(err);
    } else {
        console.log('Great Success!!');
    }
});

Obviously I have altered the username, password and IP but you should be able to get the idea.

I have tried to look through similar questions but there are none which have a good working answer from what I can see.

Thanks!

Alex Johnston
  • 99
  • 1
  • 7
  • `remote-exec` is using a very outdated version of `ssh2`. Have you tried using `ssh2` directly or some other more recent module that builds on top of it? – mscdex May 17 '17 at 15:32
  • I have just tried ssh2 and it works as I intended, thanks for the help. – Alex Johnston May 18 '17 at 08:28

0 Answers0