Is there a way that I can use Python on Windows to execute shell scripts which are located on a remote Unix machine?
P.S: Sorry about the late edit. I do know of Paramiko, but I wanted to know if there is way of doing it without it. For starters, could it be done with subprocess()?
I'd do this with Pexpect and Plink.
You will either need to run some sort of server on the remote machine, or ssh in and do it yourself. It would not be difficult to use one of the many pre-written Python servers to listen for a client and kick off a shell script.
Authentication may or may not be a problem for you; be aware that anyone else can follow the same steps you do and possibly get the same result. You don't want to allow anyone on the intarwubs to start your scripts!
You will need to ssh into the remote machine and if you have appropriate credentials, you can invoke the shell scripts.
For using ssh, you can easily use paramiko module that provides ssh automation
A typical example:
Replace "df -h" command with the your shell script.
There is not any 'batteries included' module for remote shell execution in python. I'd suggest looking into Fabric , which provides a really nice interface for working through SSH on remote machines, probably a bit nicer than paramiko. You can even install Fabric on windows...
Sure, typically via the ssh protocol (for "secure shell") as supported for Python e.g. by the paramiko third-party extension.
I've got one with multiprocessing and subprocess that i haven't tested but should work based on docs...
Server:
Remote Client: