< Back to Blogs
Running Windows Command Line Applications from a Linux Box by admin on April 19, 2006 05:42PM

Running Command Line Applications on Windows XP/2000 from a Linux Box:

Question:

-----Original Message-----
From: swagner@********
Sent: Thursday, April 13, 2006 2:35 PM
To: Port25 Feedback
Subject: (Port25) : You guys should look into _____
Importance: High

Can you recommend anything for running command line applications on a Windows XP/2000 box from within a program that runs on Linux?  For example I want a script to run on a Linux server that will connect to a Windows server, on our network, and run certain commands.

Answer:

One way to do this would be to install an SSH daemon on the Windows machine and run commands via the ssh client on the Linux machine.  Simply search the web for information on setting up the Cygwin SSH daemon as a service in Windows (there are docs about this everywhere).  You can then run commands with ssh, somewhat like:

      ssh administrator@<hostname> 'touch /cygdrive/c/blar'

That will create a file in C:\ called "blar".  You can also access Windows commands if you alter the path in the cygwin environment or use the full path to the command:

      ssh administrator@<hostname> '/cygdrive/c/windows/system32/net.exe view'

Comments RSS
  1. nektar said:

    I am disappointed that Microsoft does not offer an SSH implementation with Services for Unix or with SUA.

    posted at 03:44AM 04/23/2006
  2. szlwzl said:

    I would also very much like to see this as a built in feature - cygwin is great and I use it all the time but why not build something like this into the OS?

    posted at 04:36PM 04/23/2006
  3. breiter said:

    I'm stunned that you didn't recommend OpenSSH running on Interix from SFU 3.5 or SUA 5.2. I would much rather rely upon Interix than Cygwin. Interopsystems maintains an both a free straight OpenSSH package and an commercial enhanced version with an MMC-based GUI configurator.

    posted at 06:05PM 04/23/2006
  4. vox said:

    Of course if there was an RDP client that could access Windows full screen using a browser (the same way as Virtual Labs work) you could run GUI programs as well

    posted at 01:12AM 04/24/2006
  5. einhverfr said:

    Hi all.

    Nektar wrote:

    " I am disappointed that Microsoft does not offer an SSH implementation with Services for Unix or with SUA."

    When I was at Microsoft, the legal department raised objections.  Not sure if they were trademark related or what.  But a good substitute would be a kerberized telnet client and server that would be capable of session encryption as per the Kerberos specification.  People usually don't know that this is possible using Kerberos and telnet but it is.  And given the architecture of AD, this would lead to close integration.

    Vox wrote:
    " Of course if there was an RDP client that could access Windows full screen using a browser (the same way as Virtual Labs work) you could run GUI programs as well"

    Ever use rdesktop?  It doesn;t use a browser, but it close enough you can easily run GUI apps.

    Best Wishes,
    Chris Travers
    Metatron Technology Consulting

    posted at 01:30AM 04/24/2006
  6. docsmooth said:

    rdesktop -0 -f <servername> will work the same as mstsc /console with the fullscreen switch set.  As Chris said, it's not a browser, but it's a 100% replacement for MSTSC, and fits every single option, security and otherwise, that is in MSTSC.

    Also, KDE users have "krdc" which wraps around rdesktop and VNC, so you can connect to either, and save off your settings, just like saving .RDP files in Windows.

    Rob

    posted at 12:42PM 04/24/2006
  7. docsmooth said:

    I completely forgot this portion to my previous comment:

    Is there anyone who has experience running Windows Resource Kit tools or Windows 2003 Support Tools from Wine or similar directly off of the Linux box?  It would be fantastic to be able to run those and the MMC tools, perhaps with WinBind as the authentication path?

    As things sit right now, I have to run a VMWare WinXP instance, or dual-boot to get access to those tools that I run less frequently than certain FOSS tools, but still need.

    posted at 04:42PM 04/24/2006
  8. smither said:

    Simply install vncserver from, for example, realvnc.com, then use vncviewer on the Linux box.  You have your complete Windows desktop within a window in your X server.  Open the terminal from the start menu.

    posted at 04:39PM 04/27/2006
  9. remdotc said:

    You can either purchase a copy of Cross Over Office and/or Cedega, which allow you to run windows native binarys on linux  (directX) or you can under wine get these to work, though  you need to install
    IE 6.1
    You need to set your 0/S in wine.conf to 2000
    you need to copy most of the files contained in
    sysroot/system32 to your winex install
    performance is horrible

    The better sollution is to install a ssh server on the windows box and then remote in via command line. If you can not afford a commerical one, you can always use cygwin

    posted at 02:49PM 04/28/2006
  10. Port 25 said:

    We're interested in hearing about your biggest - and smallest - IT challenges. Send them in - your toughest pains, trivial pet peeves - and we'll try &amp; answer them....

    posted at 03:49PM 10/12/2006