From: christian l. <chr...@ti...> - 2003-01-22 22:28:22
|
> Couldn't believe there's no out of the box sshh/scp module! Came across > pyssh - but since I'm a newby parttime programmer, I really don't know how > to use it. Could someone please give me a start on how to open a session? #!/usr/bin/env python import pyssh def main(): mycon=pyssh.Ssh('tiger','localhost','22') mycon.set_debuglevel(0) mycon.set_sshpath(pyssh.SSH_PATH) mycon.login() cmd='ps auxw | grep httpd | grep -v grep ; echo $?' C=mycon.sendcmd(cmd) print C mycon.close() main() # ymmv ;-) -- |