mikeal / sequest

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

Passing ssh2 options through sequest #21

Open lazywithclass opened 9 years ago

lazywithclass commented 9 years ago

First of all thanks for this! It saved me lot of time.

My problem is that I need to run a command with sudo and I get

sudo: sorry, you must have a tty to run sudo

I've read the docs at https://github.com/mscdex/ssh2 and found out that there's a pty flag that could be passed through, I've added it to sequest options as in

var seq = sequest.connect('user@ip', {
  pty: true,
  privateKey: 'heh'
});

but with no success. I then looked at https://github.com/mikeal/sequest/blob/master/index.js#L33 and found out that you're allowing just a few options to pass through to ssh2.

Am I right that it's just a matter of sending you a PR allowing pty to be passed through?

esalter commented 9 years ago

I ran into a similar issue when needing to use SSH Forwarding/ssh-agent through a proxy. It didn't work for the same reason until I hacked the package to allow the variables to pass through. Documentation is very misleading.