Your command will run on shell/terminal. So you need to take shell first
the run your command
String[] cmd = {"/bin/sh",
"-c",
"ssh -t -o ProxyCommand ssh fox@10.0.0.1 nc %h %p
22 ubuntu@10.0.0.22 ls -l"};
On Tue, Dec 22, 2015 at 9:14 PM, Mohamed Boussaa
wrote:
> I am
I am running this command on my mac terminal :
ssh -t -o "ProxyCommand ssh fox@10.0.0.1 nc %h %p 22" ubuntu@10.0.0.22 "ls -l"
It works. But when I run it like below in eclipse:
List result = new ArrayList();
java.lang.Process pp;
try {
pp = Runtime.getRuntime().exec("s