pxssh submit su commands = very very slow

gert gert.cuykens at gmail.com
Sat Jun 28 18:38:27 EDT 2008


This works but after the su command you have to wait like 2 minutes
before each command gets executed ?
What did i do wrong ?

import pxssh

try:
            s = pxssh.pxssh()
            s.login ('127.0.0.1', 'gert', '123')
            s.sendline ('uptime')
            s.prompt()
            print s.before
            s.sendline ('ls -l')
            s.prompt()
            print s.before
            s.sendline ('df')
            s.prompt()
            print s.before
            s.sendline ('su')
            s.expect('Password:')
            s.sendline ('123')
            s.prompt()
            print s.before
            s.sendline ('df')
            s.prompt()
            print s.before
            s.sendline ('exit')
            s.logout()

except pxssh.ExceptionPxssh, e:
            print "pxssh failed on login."
            print str(e)



More information about the Python-list mailing list