public void testSsh() {
String hostname = "192.168.0.1";
String username = "root";
String password = "password";
Connection conn = new Connection(hostname);
conn.connect();
System.out.println("connect ok");
boolean isAuthenticated = conn.authenticateWithPassword(username,password);
if (isAuthenticated == false)
throw new IOException("Authentication failed.");
Session sess = conn.openSession();
sess.execCommand("rm -rf 目录");
System.out.println("Here is some information about the remote host:");
sess.close();
conn.close();
}