de.mud.ssh
public class SshWrapper extends Wrapper
SshWrapper telnet = new SshWrapper(); try { ssh.connect(args[0], 23); ssh.login("user", "password"); ssh.setPrompt("user@host"); ssh.waitfor("Terminal type?"); ssh.send("dumb"); System.out.println(ssh.send("ls -l")); } catch(java.io.IOException e) { e.printStackTrace(); }Please keep in mind that the password is visible for anyone who can download the class file. So use this only for public accounts or if you are absolutely sure nobody can see the file.
Maintainer:Marcus Mei???ner
Constructor and Description |
---|
SshWrapper() |
Modifier and Type | Method and Description |
---|---|
int |
read(byte[] b)
Read data from the backend and decrypt it.
|
java.lang.String |
send(java.lang.String cmd)
Send a command to the remote host.
|
connect, disconnect, getPrompt, getTerminalType, getWindowSize, login, setLocalEcho, setPrompt, waitfor, waitfor, write
protected SshIO handler
public java.lang.String send(java.lang.String cmd) throws java.io.IOException
public int read(byte[] b) throws java.io.IOException