delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/12/22/19:08:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <000a01c2aa17$6e4b8d10$c8c8a8c0@peace>
From: =?iso-8859-1?Q?Peter_Valdemar_M=F8rch?= <peter AT morch DOT com>
To: <cygwin AT cygwin DOT com>, "Larry Hall \(RFK Partners, Inc\)" <lhall AT rfk DOT com>
References: <4 DOT 3 DOT 1 DOT 2 DOT 20021222145240 DOT 02671d18 AT pop DOT rcn DOT com>
Subject: Re: sshd and launching e.g. word.exe - no GUI screen shows up
Date: Mon, 23 Dec 2002 01:08:32 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

Thanks a million for your reply to my post.

I tried what you suggested, and sure enough, it allows me to do exactly as I
want. However, when use these settings and the service is started, a
terminal (or "dos box") appears with absolutely nothing in it. ps -ef shows
that sshd is running. If I close the dos box, ps shows that sshd
disappeared, and surely enough I cannot log into the box.

It did however give me the starting point to find a solution that works for
me: I start sshd myself in a windows Start/Programs/Startup/ shortcut, and
then disable the service . I am the only one logged in to this machine, and
I'm always logged in, so that works fine for me. The command for the
shortcut is:

%windir%\system32\wscript.exe c:\data\scr\quiet.vbs
c:\cygwin\bin\bash --login -c "export CYGWIN='binmode ntsec tty';
/usr/sbin/sshd -D"

and quiet.vbs is a little Visual Basic magic to start Cygwin stuff and
avoiding the terminal. VERY cool and useful whenever you want to run a bash
script but don't want the terminal that goes along with it. See below.

Of course the ideal general purpose solution is to get it to work as a
service, that allows interaction with the desktop, but doesn't create a
terminal. I'm pretty sure the solution is in the registry somewhere, but I
couldn't quite figure out the logic in the registry settings. The
"ImagePath" is C:\cygwin\bin\cygrunsrv.exe, the Parameters\AppArgs is "-D",
and Parameters\AppPath is "/usr/sbin/sshd"... The only way I could get it to
work by hand was with cygrunsrv -S sshd, but then the window always seemed
to appear. Anyway...

Thanks again, Larry,

Sincerely

Peter Valdemar Mørch

quiet.vbs:
' This comes from a post found here:
'
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OnQwYL0iCHA
.1884%40tkmsftngp10&rnum=14
' from the microsoft.public.win2000.cmdprompt.admin newsgroup
' But has been modified some by peter AT morch DOT com.

Set oShell = CreateObject ("Wscript.Shell")
Set objArgs = WScript.Arguments
' Join all the arguments....
for each arg in objargs
        cmd = cmd & """" & arg & """" & " "
next
oShell.Run cmd , 0, runwait


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019