I have successfully SSH\'ed into a node, sent the input, and retrieved the output. After inputting a line, the line is printed to the console, followed by a blank line, and
These are all consequences of the "shell" channel.
You run an interactive session with all the fancy stuff that human users like.
The "shell" channel is not intended for automation.
You may remove some of these by calling channel.setPty(false)
before channel.connect()
.
Though you better use the "exec" channel.
This may work:
( echo username & echo password & echo hostname ) | command
Related questions: