I am new to apache commons-exec.
Is there a way I can send a series of commands to a remote machine without authenticating each time?
would like to do this order:
ssh a@b
command1
command2
but apparently commons-exec needs this:
ssh a@b \n command1
ssh a@b \n command2
any idea?
Try
this is a common way to execute multiple command on a remote system via ssh from within a script. This should work for your case as well.