Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Reply-To: Cygwin List Message-Id: <6.0.1.1.0.20040206112325.038f6bc0@127.0.0.1> X-Sender: Date: Fri, 06 Feb 2004 11:33:23 -0500 To: Thomas Dorf Nielsen , cygwin AT cygwin DOT com From: Larry Hall Subject: Re: Executing windows commands via ssh In-Reply-To: <16419.44027.916322.296462@thy.workstations.ima.auc.dk> References: <16419 DOT 44027 DOT 916322 DOT 296462 AT thy DOT workstations DOT ima DOT auc DOT dk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 10:00 AM 2/6/2004, Thomas Dorf Nielsen you wrote: >Hi! > >I've been through page after page without finding the answer, so now I >try here. > >We are trying to find a way to execute commands remotely on a Windows XP >box. We were hoping to be able to install a SSH server (sshd) and then >login and execute. > >But only partial success followed... > >We can install a SSH server and login to it from another PC using >eg. PuTTY, no problem. We get into the remote machine and can do dir, >cd, etc. But if we try executing other programs, nothing seems to >happen. For instance we have found a program that can change the >resolution of the Windows screen, ResSwitch. It can be called from a DOS >prompt like this: > >---------- >C:\>ResSwitch 800 600 32 60 >---------- > >If it is run without the right number of parameters ResSwitch displays a >requester explaining it's usage. > >If we run the same command via SSH nothing happens! The prompt just >returns and nothing is changed: > >---------- >C:\>ResSwitch 800 600 32 60 > >C:\> >---------- > >This is strange, as the "ResSwitch.exe" *is* found. This we believe >because we get an error if we type something non-existant: > >---------- >C:\>thingy >'thingy' is not recognized as an internal or external command, >operable program or batch file. >---------- > >So what to do? Do we need to tell the Windows environment to allow the >SSH login to manipulate the Windows settings, some kind of "xhost +"? > >If this *is* in the documentation somewhere please forgive me and direct >my attention in the right direction! :-) Actually, this sounds to me like you're trying to interact with your desktop remotely, which is a topic that's been covered before for Cygwin and ssh. I'm sure there's something in the email archives about it, though I haven't looked for a specific pointer for you. If I'm right, you need to specify the '-i' flag to 'cygrunsrv' when you install 'sshd'. You can also achieve this after the fact by launching the "Services" applet (of "Administrator Tools") in Windows (NT and later) and check "Allow service to interact with desktop" under the "Log On" tab. You can get to the "Administrator Tools" from the control panel, among other ways. If this isn't the problem, just build ResSwitch as debugable and debug it (you'll want something like VNC if you plan to try to do this remotely with VC++). I assume you know the source is available from Code Project if you don't already have it. Good luck, -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 838 Washington Street (508) 893-9889 - FAX Holliston, MA 01746 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/