Using Python to run SSH commands on a remote server

Jeffrey Froman jeffrey at
Mon Jun 23 20:17:40 CEST 2008

John Salerno wrote:

> Generally speaking, what tools would I use to do this? Is there a built-in
> module for it?

I've had a very nice experience using the 3rd-party package "paramiko" for
ssh communication. There's nothing in the standard library that I know of.

> I looked at the telnetlib module, but the documentation 
> wasn't really complete enough for me to get a good idea of it. Is Telnet
> and SSH even the same thing?

Telnet is not the same protocol. SSH is an encrypted transport, telnet is

> Basically, I want to write a script that will automate the process of
> making all .py files on my web server executable (chmod 755, or something
> similar).

Be careful, this procedure sounds potential risky, security-wise ;-)


More information about the Python-list mailing list