JASSH is a high level scala SSH API for easy and fast operations on remote servers. ( ** project page **)

Latest changes :
  • JSCH updated to release 0.1.47
  • SSHOptions now contains an extra field "name" which allow user to friendly identify a remote ssh system
  • SSHOptions password type is now of SSHPassword type instead of String. Implicit conversions are provided from String, Option[String]
  • SSHShell batch method renamed to execute

hello scala script


#!/bin/sh
exec java -jar jassh.jar -nocompdaemon -usejavacp -savecompiled "$0" "$@"
!#

print(jassh.SSH.shell("localhost", "test", "testtest") {_ execute "echo Hello `hostname`" } )


remote vmstat scala script


#!/bin/sh
exec java -jar jassh.jar -nocompdaemon -usejavacp -savecompiled "$0" "$@"
!#

jassh.SSH.once("localhost", "test", "testtest") {
_.run("vmstat 1 10", println(_.getOrElse("")).waitForEnd
}