mikeal / sequest

Simplified API for SSH and SFTP similar to request.
283 stars 24 forks source link

Continues mode example does not work #27

Open kevinsimper opened 9 years ago

kevinsimper commented 9 years ago

I took the example from the frontpage, and added a private key, but exists without any output.

var sequest = require('sequest')
var fs = require('fs')

var seq = sequest('docker@192.168.99.106', {
  privateKey: fs.readFileSync(__dirname + '/key.file')
})
seq.pipe(process.stdout) // only necessary if you want to see the output in your terminal
seq.write('docker ps')
seq.end()

But this example is fine:

var sequest = require('sequest')
var fs = require('fs')

sequest('docker@192.168.99.106', {
  command: 'docker ps',
  privateKey: fs.readFileSync(__dirname + '/key.file')
}, function (err, stdout) {
  console.log(err, stdout)
})
codeclown commented 8 years ago

Did you find a solution to this? Having the same issue.

codeclown commented 8 years ago

Explored the tests and found a working way:

var seq = sequest.connect(host, options)();
DmitryEfimenko commented 5 years ago

I still can't get this to work. The solution by @codeclown does not seem to work for me. I'm getting the error:

All configured authentication methods failed

However, when using exactly the same options and using the callback signature, everything works...