How can I run an application on a remote machine by ssh?
问题 How can I run an application on a remote machine via ssh? I tried using JSCH, this way: Properties props = new Properties(); props.put("StrictHostKeyChecking", "no"); String host = "111.111.11.111"; String user = "myuser"; String pwd = "mypass"; // int port = 22; JSch jsch = new JSch(); Session session = jsch.getSession(user, host); session.setConfig(props); session.setPassword(pwd); session.connect(); System.out.println(session.getServerVersion()); System.out.println("Conected!"); // String