PySSH |
PySSH is a Python library for programmatically controlling ssh and scp.
import pyssh pyssh.run('date', host=HOST, user=USER)
You can also add a password=PASSWORD argument, if you haven't set up RSA key pairs.
Chuck Esterbrook with examples (and code lifted) from Drew McDowell and Adam Grzegorz.
At the home page at http://pyssh.sourceforge.net/.
Check the To Do list if you're looking for something, or inquire on the discussion list. Share any patches, enhancements, modules, docs, etc. that you wish via the discussion list as well. pyssh-discuss@lists.sourceforge.net
We use the Python license. See license.txt.
PySSH requires Python 2.0 or greater and uses the pty module found in Python, but only for IRIX and Linux. If you can use PySSH on other platforms, particularly some flavor of POSIX, please let us know.
For a single user, copy the pyssh.py module to a location in your PYTHONPATH.
For a system, become the administrator and run python setup.py install at the command prompt.
> python pyssh.py host=HOST user=USER command=date password=PASSWORD
You can skip the password if you have set up RSA key pairs.
If this doesn't work, try using your ordinary ssh program first:
> ssh USER@HOST COMMAND
If ssh works, but pyssh does not, turn debugging on with "debug=1" passed on the command line and contact pyssh-discuss.
import pyssh pyssh.run('date', host=HOST, user=USER, password=PASSWORD)
The doc string contains more info. The source code for pyssh contains additional classes and functionality you can read through.
Docs:
PySSH home:
SSH info:
This section contains instructions on how to cut a release. @@