delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/05/02/18:52:02

X-Spam-Check-By: sourceware.org
Message-ID: <4457E24C.2020303@well-dunn.com>
Date: Tue, 02 May 2006 17:50:52 -0500
From: Mike Dunn <mike DOT dunn AT well-dunn DOT com>
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Win2003 server and cron/sshd as services (1.5.19)
References: <C874DBE9D30B584587F8CD0EC34DA8BE016C809E AT EX00 DOT idirect DOT net>
In-Reply-To: <C874DBE9D30B584587F8CD0EC34DA8BE016C809E@EX00.idirect.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

  Hi Mark,

Thanks for looking at this with me.  I have restarted the sshd service 
many times, and have provided the password for the sshd_server account 
each time I've installed the service (whether installing it manually or 
with ssh-host-config).  Below is how I have been typically installing 
the service, when doing it manually.  It appears to be functionally 
equivalent to your script.

It's strange how the service starts normally, and sshd enters the 
process table, but it appears to refuse to run.  I wonder if there is a 
way to test my password for the sshd_server account (or would cygrunsrv 
complain if it were wrong?)

  Thanks
  Mike Dunn

mdunn AT h-dlt ~
$ cygrunsrv -Q sshd
Service             : sshd
Display name        : CYGWIN sshd
Current State       : Running
Controls Accepted   : Stop
Command             : /usr/sbin/sshd -D

mdunn AT h-dlt ~
$ cygrunsrv -E sshd

mdunn AT h-dlt ~
$ cygrunsrv -R sshd

mdunn AT h-dlt ~
$ cygrunsrv -I sshd --shutdown -p /usr/sbin/sshd -a "-D -ddd" \
 >   -d "CYGWIN  sshd" -u sshd_server -w a_fine_password -e 
"CYGWIN=binmode ntsec tty"

mdunn AT h-dlt ~
$ cygrunsrv -S sshd

mdunn AT h-dlt ~
$ ls -l /var/log/sshd.log
-rw-r--r-- 1 sshd_server None 0 May  2 12:13 /var/log/sshd.log

mdunn AT h-dlt ~
$ date
Tue May  2 17:38:35 CDT 2006

mdunn AT h-dlt ~
$ netstat -an | grep -i LIST
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1025           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2967           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:6389           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:10000          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13701          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13711          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13720          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13721          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13722          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13723          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13724          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13782          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13783          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:34571          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:34572          0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1047         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1052         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1057         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1060         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1072         0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1131         0.0.0.0:0              LISTENING
  TCP    172.16.20.27:139       0.0.0.0:0              LISTENING
  TCP    172.16.90.89:139       0.0.0.0:0              LISTENING

mdunn AT h-dlt ~
$ telnet localhost 22
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

mdunn AT h-dlt ~
$





Harig, Mark wrote:
>> I've been having problems getting cron/sshd to work properly (as
>> services or not as services) on a Win 2003 server.  I understand that
>> certain attributes of the SYSTEM account changed in win2003, and I've 
>> tried to allow ssh-host-config to setup sshd, but with no success.  I
>> have tried setting up both sshd and cron manually (following relevant 
>> win2003 advice from
>>     
> http://www.cygwin.com/ml/cygwin/2003-11/msg00368.html), but I still
>   
>> cannot seem to get either service to work properly.
>>     
>
> Have you stopped and started the ssh service several times?  If so,
> have you remembered to provide the password that that 'ssh-host-config'
> requires you to create?  It would be helpful in diagnosing your problem
> if you were to provide the text of your commands for starting and
> stopping
> the ssh service.
>
> Here is an edited copy of the command that I have put into a wrapper
> script to start the ssh service.  I am running sshd on several computers
> running W2003.  I have edited out the password that I use.  See the
> cygrunsrv documentation for a description of its options.
>
> start_sshd.sh
> ------------
>
> #!/bin/bash
>
> # Stop if any errors occur.
> set -o errexit;
>
> # If there is a running service, then stop it and remove it.
> cygrunsrv --query sshd > /dev/null 2>&1 && {
>         cygrunsrv --stop $service;
>         cygrunsrv --remove $service;
> };
>
> # Install the sshd service.
> cygrunsrv --install sshd --shutdown --path /usr/sbin/sshd --args "-D" \
>     --disp "Cygwin sshd" --desc "Cygwin Openssh service" \
>     --user sshd_server --passwd "your_fine_password" \
>     --env "CYGWIN=binmode ntsec tty";
>
> # Start the sshd service.
> cygrunsrv --start sshd;
>
> # === End of start_sshd.sh === #
>
>
> Of course, since 'your_fine_password' is provided in clear text, you'll
> want to keep this script protected, or maybe change the script to
> prompt you for the password.
>
>
> --
> 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/
>
>   


--
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/

- Raw text -


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