|
Project Information
Featured
Downloads
Links
|
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 Python, Ruby and BeanShell. This tool requires Java 5 or greater. Here is an example script, 'date.py', that connects to a remote SSH server and gets the output of the 'date' command: ssh.connect('myserver', 'myusername');
ssh.waitFor(':~>');
ssh.sendLine('date');
print 'Server date is '+ssh.getLine();
ssh.disconnect();To execute this script with the script and enchanter jar in the current directory, run java -jar enchanter-python-VERSION.jar date.py Features
Latest release: 0.5.1
DocumentationCommon commands for the 'ssh' variable include:
For a full list of commands, see the SSH interface ExamplesEach scripting language build has its own examples: Comments or suggestions? Any feedback is appreciated. |