delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/09/08/12:21:08

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <CFC4F26947496E4092489B24256149581F8D7D@svc-msg-02.northamerica.corp.microsoft.com>
From: Tommy Williams <tommyw AT microsoft DOT com>
To: "'cygwin AT sources DOT redhat DOT com'" <cygwin AT sources DOT redhat DOT com>
Subject: sshd working as service under Win2K?
Date: Fri, 8 Sep 2000 09:20:10 -0700
X-Mailer: Internet Mail Service (5.5.2651.58)

Has any gotten sshd to run as a service under Win2K (either Professional or
Server)?

It works fine if I run it from the command line, but I cannot get it to run
as a service. I also cannot get inetd to run as a service. Details below.

Here begins a long message of things I've tried, so please be patient.

Versions:

Windows 2000 Professional or Server, with Service Pack 1
Cygwin 1.1.4
OpenSSH 2.2.0p1
instsrv.exe and srvany.exe from the Win2K Server Resource Kit
    -- I tried instsrv.exe and srvany.exe from the NT resource
       kit and got the same results
CYGWIN env var is empty
Cygwin installed at C:\cygwin

Procedure:

(1) Acquired the OpenSSH source from:
 
ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Vinschen_Cori
nna/V1.1.4
    and unpacked it.

(2) Modified /etc/passwd to set up a home directory, following suggestions
    in /usr/doc/Cygwin/login.README and openssh-2.2.0p1.README

(3) /usr/local/bin/ssh-config

(4) /usr/local/sbin/sshd.exe

(5) ssh localhost

At this point, everything worked. I could log into the machines from FreeBSD
machines, from other Windows boxes, scp, etc. I was happy. I was even able
to build rsync 2.4.6 and, using ssh as a transport, rsync between the W2K
boxes and some FreeBSD machines.

Then I realized that I needed to run it as a service. So here's the service
process (all this done as user Administrator):

(1) Install Win2K Server Resource Kit and copy instsrv.exe and srvany.exe to
    /usr/local/bin.

(2) instsrv sshd "C:\\cygwin\\usr\\local\\bin\\srvany.exe"
    -- Service installs successfully

(3) Run the following through regedit:

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd]
"ObjectName"="LocalSystem"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servecs\sshd\Parameters]
"Application"="C:\\cygwin\\usr\\local\\sbin\\sshd.exe"

(4) net start sshd
    -- Response:
    The sshd service is starting.
    The sshd service was started successfully.

(5) ps
    -- Response:
      PID TTY
    1050   -1  08:58:15 /usr/bin/ps.exe
    1000   -1  08:18:51 /usr/bin/bash.exe

Nothing is listening on port 22 on the machine. Checking the task manager, I
see that srvany.exe is indeed running. But sshd.exe is not.

I then tried to set things up to run under inetd. I followed the
instructions on an earlier message I found on the mailing list archives. I
got it installed as a service, but when I try to start it:

  The service is not responding to the control function.

  More help is available by typing NET HELPMSG 2186.

So I can only run sshd when I run it from the command line. I get the same
results on either Win2K Professional or Server.

If anyone has gotten sshd to work as a service under Win2K, please let me
know how you did it.

Thanks.

-- 
Tommy Williams     <tommyw AT microsoft DOT com>
Microsoft bCentral <http://www.bcentral.com> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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