This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Executing windows commands via ssh


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]