sanketbajoria / ssh2-promise

ssh with promise/async await and typescript support
https://www.npmjs.com/package/ssh2-promise
MIT License
148 stars 24 forks source link

can you provide some example for connect the ssh with same session and pass multiple commands using ssh2-promise #81

Open mrgsathyaraj opened 2 years ago

mrgsathyaraj commented 2 years ago

Hi @sanketbajoria ,

I am working in a project that requires multiple commands to be passed in the ssh server using same ssh shell session . am not able to find how the multiple commands working with shell .

It will be helpful if you could add some example or concept how it can be done then it will be helpful .

sanketbajoria commented 2 years ago

@mrgsathyaraj sorry didn't able to respond earlier.. do you still need help?

mrgsathyaraj commented 1 year ago

@sanketbajoria

yes I still need the help . what exactly i needed let me describe here .

  1. login to the ssh using ssh.connect() method-Done
  2. I need to read the console contents everytime then send the mentioned command as input Note : I need to send multiple commands one by one based on the console output that is displayed .

can you help on this .