agebrock / reverse-tunnel-ssh

Easy reverse tunnel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example not working

roccomuso opened this issue · comments

This the example that I'm running:

var tunnel = require('reverse-tunnel-ssh');
// This is a very handy way to test your next webhook !

// Please set up your /etc/hosts or change the hostname befor
// running the example.

var config = {
  host: '192.168.88.111',
  username: 'root',
  dstHost: '0.0.0.0', // bind to all interfaces (see hint in the readme)
  dstPort: 8818,
  //srcHost: '127.0.0.1', // default
  //srcPort: dstPort // default is the same as dstPort
}
tunnel(config, function(error, clientConnection) {
  if (error) console.log(error);
  console.log(clientConnection._forwarding);
});

require('http').createServer(function(res, res){
  res.end('SSH-TUNNEL: Gate to heaven !');
}).listen(config.dstPort);

console.log('Tunnel created: http://'+config.host+':'+config.dstPort);

This the error:

Error: All configured authentication methods failed
    at tryNextAuth (/home/rocco/Desktop/PROVE/reverse-ssh-tunnel/node_modules/reverse-tunnel-ssh/node_modules/ssh2/lib/client.js:377:17)
    at SSH2Stream.onUSERAUTH_FAILURE (/home/rocco/Desktop/PROVE/reverse-ssh-tunnel/node_modules/reverse-tunnel-ssh/node_modules/ssh2/lib/client.js:575:5)
    at emitTwo (events.js:87:13)
    at SSH2Stream.emit (events.js:172:7)
    at parsePacket (/home/rocco/Desktop/PROVE/reverse-ssh-tunnel/node_modules/reverse-tunnel-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/ssh.js:3923:10)
    at SSH2Stream._transform (/home/rocco/Desktop/PROVE/reverse-ssh-tunnel/node_modules/reverse-tunnel-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/ssh.js:667:13)
    at SSH2Stream.Transform._read (_stream_transform.js:167:10)
    at SSH2Stream._read (/home/rocco/Desktop/PROVE/reverse-ssh-tunnel/node_modules/reverse-tunnel-ssh/node_modules/ssh2/node_modules/ssh2-streams/lib/ssh.js:251:15)
    at SSH2Stream.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:300:12)

What am I doing wrong?

So I should provide a password into the configuration.
Wouldn't be useful updating the example then?

Thanks

Hi again sorry for the delay ;)

Indeed more information would be usefull. My plan is to provide a ssh-server via docker for testing.
Sorry for the confusion.