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<String> result = new ArrayList<String>(); java.lang.Process pp; try { pp = Runtime.getRuntime().exec("ssh -t -o ProxyCommand ssh fox@10.0.0.1 nc %h %p 22 ubuntu@10.0.0.22 ls -l"); pp.waitFor(); BufferedReader br = new BufferedReader(new InputStreamReader(pp.getInputStream())); String line = ""; while ((line = br.readLine()) != null) { System.out.println("line :"+line); result.add(line); } } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } It doest not work and does not print any thing on the console. Do you have an idea ? ------------------------------------------------------------------------------ _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users