how to kill a process running on remote windows machine from linux?

5,358

Solution 1

The PSKILL tool does what it does by:

  • Copy the file to the target machine
  • Using WMI to create a service on the target machine that launches the file copied
  • Starts the service on the remote machine
  • Removes the service on the target machine
  • Removes the file from the target machine

Samba, and by extension Linux, can do the first and last bullet-points. The others are currently not possible. Such a tool does not exist.

Solution 2

Maybe a bit late:

Well it is possible if you have installed sysinternals/microsoft PSkill on your server. and you have a user on your server that has the rights to run rpc commands.

from your linux run the following commands:

net rpc service create killproc killproc "%windir%\pskill <program name|process id>" -I <server ip> -U <username>%<password>

net rpc service start killproc -I <server ip> -U <username>%<password>

net rpc service delete killproc -I <server ip> -U <username>%<password>

Hope it helps

Share:
5,358

Related videos on Youtube

Boris Daich
Author by

Boris Daich

20 years of experience as C/C++/Java developer. Big fan of Java.

Updated on September 17, 2022

Comments

  • Boris Daich
    Boris Daich almost 2 years

    I am looking for something like SysInternals pskill which is just great!

    But that can be executed on Linux more exactly I want it to run on Maemo (Nokia N900 phone). Please do not offer me to run a Wine or any other windows emulation environment.

    Of course I got the credentials for the Windows machine and windows machine is general Windows XP or Windows 7 not Windows Server.

    • Lovethenakedgun
      Lovethenakedgun over 13 years
      This does not sound like a programming-related question ?
  • Boris Daich
    Boris Daich over 13 years
    Thanks! This is clear and educational. But let me rephrase the question. Can it be any done at all in any way? I do not care how :-)
  • Deb
    Deb over 13 years
    @BorisDaich The short-version: 1) install Cygwin to the target, 2) SSH in, 3) pskill it from there. Alternately, use rdesktop to connect to target, pskill it from there.