Getting to an SSH account over a HTTP proxy

Willi Richert w.richert at gmx.net
Tue Jan 23 05:28:05 EST 2007


Am Dienstag, 23. Januar 2007 02:16 schrieb Nanjundi:
> BJörn Lindqvist wrote:
> > I want to use Python to connect to a SSH account over a HTTP proxy to
> > automate some operations. I thought paramiko would be able to do that,
> > but it can not (it seems).
> >
> > Is there some other Python module that can do what I want?
> >
> > --
> > mvh Björn
>
> Did you take a look at twisted library?
> twistedmatrix.com
> http://twistedmatrix.com/projects/core/documentation/howto/clients.html
>
>
> I haven't tried to connect over port 80, but its worth a try.
>
> -N

If you need it for automation you might want to use pexpect: 
http://pexpect.sourceforge.net/

It listens to the tty-stream and simulates a user typing in commands. It is 
very useful, e.g. if you want to start processes on many machines over ssh. 
If there are gateways/firewalls between - no problem just use a 
second "sendline('ssh user at nextmachine')"

The only problem is the regular expression: If e.g. you use a custom $PS1 
variable for your prompt you have to account for that.

Regards,
wr



More information about the Python-list mailing list