steelbrain / node-ssh

SSH2 with Promises
MIT License
940 stars 95 forks source link

add custom parameter to ssh connection config #450

Open carlosivanrangel opened 1 year ago

carlosivanrangel commented 1 year ago

Is currently possible to add a custom parameter or option to the connection config? For example: -t customparameter

This: ssh localhost -l steel -t customparameter

Here:

ssh.connect({
  host: 'localhost',
  username: 'steel',
  privateKey: Buffer.from('...')
})

Thanks in advance.

steelbrain commented 1 year ago

Hello! My knowledge about ssh2 beyond the common used options is limited. A quick search on explainshell explained that -t customparam means the following

Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

I couldn't find a 1-to-1 mapping of the option but you may have a better luck. The full list of options is available at https://github.com/mscdex/ssh2

Good luck!