programmatically control ssh

 Sometimes, during nightly build, packaging or deployment there's a need to retrieve remote files or control a remote machine. Doing this through ssh is tricky. A common tool to use is 'expect', but it is unixy and requires knowing Tcl.

 

The enchanter tool (http://code.google.com/p/enchanter/) can be used instead. From the site:

Enchanter is a small library that helps you script SSH sessions in a manner similar to Expect. It comes in multiple flavors that support different scripting languages including PythonRuby and BeanShell. This tool requires Java 5 or greater.

 



Share this article: