Scripting SSH with Python

Stian Husemoen stianh at ifi.uio.no
Wed Oct 25 04:04:46 EDT 2000


Lenny Self wrote:
>help.  When I make the SSH connection I am prompted to enter a password...
>my problem is that I don't know how to look for this promt and have the
>script submit the password for me.  Can anyone give me some help on this.
>
>I have been experimenting with os.popen and os.popen3 but I am either
>looking in the wrong spot or I am not doing it correctly.
>
>Any help would be greatly appriciated.

SSH needs to speak to a pty if I remember correctly. It dies on you if it
don't. You have to use the pty package.

I did something like this a while back, but I can't seem to find my old
code, so I can't give you an example, sorry.

-- 

Stian Husemoen <stianh>



More information about the Python-list mailing list