reverse-tunnel-ssh
reverse-tunnel-ssh copied to clipboard
Example not working
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?
Hi the example does not provide any password for the root user. It only works if you are using a ssh agent.
Please make sure you can login without password on your shell (bash, ps).. or setup a password in the configuration.
hope that helps.
Am 22.12.2016 05:22 schrieb "Rocco Musolino" [email protected]:
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?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/agebrock/reverse-tunnel-ssh/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AAL-pwHJKIlB0_fZ15XKzHtpPw2xCddhks5rKaajgaJpZM4LTcD2 .
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.