Sending commands from Ubuntu to Windows
On our home network we have one Windows 7 only PC and several computers with Ubuntu 13.04 (dual boot with backup Windows 7 for programs that can't be run using wine).
We want to be able to send commands (like msg
or shutdown
etc.) to that Windows PC (and if possible we want that Windows 7 PC to be able to send commands to the Linux PCs).
How do I do this?
Solution 1:
You reminded me about winexe:
Download the tarball from the project page at http://sourceforge.net/projects/winexe/
wget "http://downloads.sourceforge.net/project/winexe/winexe-1.00.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fwinexe%2F&ts=1377024055&use_mirror=hivelocity"
I'm using a hot link for illustrative propose.
-
Untar the file:
tar zxf winexe*.tar.gz cd winexe*
-
Configure it:
./autogen.sh ./configure
-
Make it:
make
Then you can either install it, or running it with ./winexe
:
./winexe -U "Administrator" //some-pc 'shutdown.exe'
It follows the same syntax as psexec
Microsoft tool.
Solution 2:
If you install cygwin on windows machines, and also install sshd, then you will be able to give any remote commands through ssh. From windows to linux you can give remote commands through putty (ssh).
Solution 3:
Here are instructions for installation of Winexe, as summarised from http://www.aldeid.com/wiki/Winexe by Akisame (the quoted code snippets are copied verbatim from the original source):
For the people from the future I give thee the prerequisites (I had them except autoconf but it's a common problem so I'll just give them all).
sudo aptitude install build-essential autoconf checkinstall \ python python-all python-dev python-all-dev python-setuptools libdcerpc-dev
Next you use the autogen.sh
from source4 and follow the instructions from there on. When you're finished run
make basics bin/winexe
(this will take some time)
./bin/winexe -V
You should get "Version 4.0.0alpha11-GIT-UNKNOWN"