Skip to content Skip to sidebar Skip to footer

Python Output To Terminal During Ssh Login

I have been looking everywhere for this and have not found a solution. I am using python 2.5.1 on an Apple iPod and I am trying to connect to a host with SSH. First I start off wit

Solution 1:

take a look at pexpect, it should do the trick in the manner you expect it.

Example from the docs:

child = pexpect.spawn('scp foo myname@host.example.com:.')
child.expect ('Password:')
child.sendline (mypassword)

Yes, that's yet another module.. but the cleanest way to accomplish what you want.

Solution 2:

Or use passwordless, passphraseless ssh: http://stromberg.dnsalias.org/~strombrg/ssh-keys.html

No additional module required.

Post a Comment for "Python Output To Terminal During Ssh Login"