package com.test; import de.mud.ssh.*; /** *//** * This is an example for using the SshWrapper class. Note that the * password here is in plaintext, so do not make this .class file * available with your password inside it. */ publicclass SshWrapperExample { publicstaticvoid main(String args[]) { SshWrapper ssh =new SshWrapper(); try { byte[] buffer =newbyte[256]; ssh.connect("192.168.2.155", 23); ssh.login("root", "root"); ssh.setPrompt("#"); ssh.send("sar 1 3"); ssh.read(buffer); System.out.println(new String(buffer)); } catch (java.io.IOException e) { e.printStackTrace(); } } }