SSH, remote login, and command output

Rob Williscroft rtw at freenet.co.uk
Sun Mar 26 13:36:19 CEST 2006


Spire 01 wrote in
news:mailman.3688.1143360926.27775.python-list at python.org in
comp.lang.python: 

> Greetings!
> 
> I'm working on a Python program for a small LAN of Linux systems
> running Gentoo, and I need a little help figuring out what I need to
> do it.  So what I'd like to do is, from any given computer, log on to
> every other computer, run a certain command (which normally outputs
> text to the terminal), and store the output so I can use the aggregate
> statistics later in the program. 
>   I would normally something along the lines of SSH to do it, but I
>   don't 
> know what I would need to pull that off in Python.  There's also one 
> complication: the systems could be Gentoo systems, or they could be
> logged into Windows since they're dual booted.  Considering all of
> this, can anyone give me some recommendation as to what library I
> should learn how to use to pull this off? I admit, I haven't done too
> much in the way of networks, but if someone can tell me what I need to
> do remote logins in this way, I'll do what I can to make it work.
> 

I found this:

    	http://pyssh.sourceforge.net/

which may be able to help you script ssh, alternativly use the
subprocess module:

    	http://docs.python.org/dev/lib/module-subprocess.html

and translate however you would "normaly" script ssh.

To connect to windows, you could install:

    	http://sshwindows.sourceforge.net/

on your windows clients, but IIRC its win2K, XP only, or you 
could use cygwin (which the above is taken from).

Rob.
-- 
http://www.victim-prime.dsl.pipex.com/



More information about the Python-list mailing list