Executing a file remotely

Cameron Laird claird at lairds.com
Wed Feb 11 19:29:42 EST 2004


In article <slrnc2lf46.16j.bignose-hates-spam at rose.localdomain.fake>,
Ben Finney  <bignose-hates-spam at and-benfinney-does-too.id.au> wrote:
>On 11 Feb 2004 15:20:41 -0800, Hank wrote:
>> I was wondering how I would execute a file remotely?
>
>That depends on how you'd execute any command on a remote machine.  On
>Unix systems, the preferred way these days is to use ssh:
>
>    bignose at desktop$ ssh bignose at remoteserver 'command -with -args'
>
>Assuming the 'ssh' command is available on the local machine, you could
>execute the above command within the Python script using os.system():
>
>    <http://www.python.org/doc/1.5.2p2/lib/os-process.html>
			.
			.
			.
I believe soundwave56 is focused on Windows hosts.  There, the
correct initial answer to, "how would I execute a file remotely?"
is, through a security breach.

That's a serious answer.  Operating systems are not *supposed* to
allow "outsiders" to execute processes.

There are, of course, plenty of more-or-less legitimate reasons
you might need to execute remote processes.  At a minimum (again,
assuming you don't exploit holes in Windows), you'll need to 
configure the remote host ahead of time in one of several ways
which provide for remote process launching.  Which of those
several ways should you choose?  It depends.  At this point, it
might help to understand your larger goals.  Is this really about
file backup, or inventory management, or network administration,
or ...?
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net



More information about the Python-list mailing list