I want to be able to send many consecutive command represented as strings within a Java application to a SSH server for execution. Should I use:
Channel cha
With shell channel the shell (on unix it's sh or bash or something like that, on Windows it's usually cmd.exe) is started and console is created (the same you see on the screen if you run them locally). You have a prompt which you can parse or use for detection of completion of command.
With command channel a shell instance is started for each command (actually the channel is opened for each command) and a command is passed as a parameter for the shell (on Windows it would look like "cmd.exe /c ".
It's easier to use command channel cause you don't need to deal with command prompt.