ssh and Python

John Hunter jdhunter at nitace.bsd.uchicago.edu
Sun Jul 21 14:34:32 EDT 2002


>>>>> "edadk" == edadk  <e.d.andersen at mosek.com> writes:

    edadk> I would like to write script that using ssh automatically
    edadk> execute commands commands on a remote machine. How can I do
    edadk> that?

For simple stuff, you have at your disposal, for example:

import os
h = os.popen('ssh -2 somehost.com ls')
print h.read()

John Hunter



More information about the Python-list mailing list