Using Python to run SSH commands on a remote server

subeen tamim.shahriar at
Tue Jun 24 06:27:48 CEST 2008

On Jun 24, 3:51 am, John Salerno <johnj... at> wrote:
> Jeffrey Froman wrote:
> > Also note that "all .py files on my web server" is not necessarily
> > restricted to CGI scripts -- and therein lies the real gist of my
> > cautionary note.
> Yeah, I realized that afterwards. Good point. I was assuming all my
> executable files would be CGI, but that's not a good assumption to make! :)

You can execute ssh using os.system(). Look at
If you want non-interactive ssh (so that your script doesn't need to
enter password), look at:


More information about the Python-list mailing list