Java SSH tools - easier SSH & SFTP in Java
Sshtools is a wrapper around http://www.jcraft.com/jsch/. The goal is to make it easier to do SSH & SFTP in Java, as using Jsch can be a little tricky.
SshServerInfo serverInfo =
new SshServerInfo(
"login",
"localhost",
"/home/user/.ssh/id_rsa",
null);
SshProcesses
.files()
.deleteFile(
serverInfo,
"/home/user/test.txt",
true,
true);
List<SshCommand> commands =
Lists.newArrayList(
new SshCommand("java -version"),
new SshCommand("cd /data"),
new SshCommand("ls -l"));
SshService
.shell(serverInfo, commands, false)
You can find examples here: Examples