When trying to run the above mentioned commands using
Channel.setcommands(pbrun su – tech_user; bash)
The code is stucked in deadlock and keep running.
Note – ‘bash’command doesn’t return any output.
First ‘tech_user’ is authenticated using SSH
I tried the code as given in the below link, only change is I need to mandatorily run the above two commands sequentially.
https://www.digitalocean.com/community/tutorials/jsch-example-java-ssh-unix-server
New contributor
Nitish Goyal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.