delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/09/07/22:02:55

X-Spam-Check-By: sourceware.org
Date: Thu, 07 Sep 2006 22:02:10 -0400
From: "Ron Dozier" <dozier AT udel DOT edu>
Subject: sshd is running as a service but cygwin and services.mmc thinks it's not
To: <cygwin AT cygwin DOT com>
Message-id: <000801c6d2ea$cbeb8d30$0201000a@RPC>
MIME-version: 1.0
X-Mailer: Microsoft Office Outlook 11
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

sshd has it's signals crossed.

Summary:

A program called active ports says sshd is running and windows and cygrunsrv
-Q sshd says it's not.  Windows and cygwinsrv are both lying since I can log
in.

I can't stop the service, because windows and cygwin think it's not started.

but I can stop sshd.exe with active ports "Terminate Process" button.

The output from tasklist and Active Ports at boot with sshd installed as
service are shown later. 

End summary.

I was having problems with sshd not allowing logins until I issued a "net
start sshd" command which proceeded abnormally, but allowed logins on a work
computer.

I took the issue to my Laptop and did what I'm supposed to do:

I upgraded to the latest and greatest version of cygwin a few days ago.

Service was installed using "cygrunsrv -I sshd -p /usr/sbin/sshd -y tcpip

I used the freeware program "Active Ports" to monitor the port connections.
This program can also terminate processes.

Here are the problems:


Cygrunsrv is installed as a service.
I can login to my laptop from a Unix host even when no user is logged in.
(good)

Active Ports shows that 2 instances of sshd are running.
      sshd.exe	2104	127.0.0.1	1038			LISTEN	UDP
C:\cygwin\usr\sbin\sshd.exe

      sshd.exe	2104	0.0.0.0	22			LISTEN	TCP
C:\cygwin\usr\sbin\sshd.exe

cygrunsrv -Q sshd reports sshd as "stopped" (not good)


              normal AT RPC ~
             $ cygrunsrv -Q sshd
             Service             : sshd
             Current State       : Stopped
             Command             : /usr/sbin/sshd


normal AT RPC ~
$

services.mmc reports that I can only start the service
 (not good, but consistant with cygrunsrv -Q sshd)

If I try to stop the service with "net stop sshd" I get.


normal AT RPC ~
$ net stop sshd
The sshd service is not started.

More help is available by typing NET HELPMSG 3521.


normal AT RPC ~
$

SO ACTIVE PORTS SAYS sshd IS RUNNING AND WINDOWS AN CYGWIN SAY IT'S NOT.
WINDOWS AND CYGWINSRV ARE BOTH LYING SINCE I CAN LOG IN.

I CAN'T STOP THE SERVICE, BECAUSE WINDOWS AND CYGWIN THINK IT'S NOT STARTED.

BUT I CAN STOP sshd with Active Ports.

 When I stop it, I cannot log in. (used the simple test)

normal AT RPC ~
$ ssh rpc
ssh: connect to host rpc port 22: Connection refused

normal AT RPC ~
$

So now.

Try to start the service using "net start sshd"


normal AT RPC ~
$ net start sshd
The sshd service is starting.
The sshd service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.


normal AT RPC ~
$ ssh rpc
Last login: Thu Sep  7 20:28:22 2006 from copland.udel.edu
Fanfare!!!
You are successfully logged in to this server!!!

normal AT RPC ~
$

Net start sshd reports an error, but I can log in (Huh).

sshd shows up in Active Ports and I can log in again.

Active Ports is here:

http://www.tucows.com/preview/213738

So, it's likely that I can upgrade and make sshd work on the desktop and
create a new problems.  Services.mmc, and cygrunsrv -Q sshd both think that
the service is stopped when it's actually running and you can't stop sshd
using those programs.  I must use Active Ports.   I went down other paths,
but his is the most direct path.  I'm very confused.  Both systems are
Windows XP Pro and I haven't upgraded the one that doesn't start the service
automatically before you are logged in.

The output from TASKLIST and Active Ports just after login when sshd is
installed as a service is enclosed.

Any ideas?



Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\normal>tasklist (at startup)

Image Name                   PID Session Name     Session#    Mem Usage
========================= ====== ================ ======== ============
System Idle Process            0 Console                 0         28 K
System                         4 Console                 0        236 K
smss.exe                    1468 Console                 0        392 K
csrss.exe                   1516 Console                 0      4,628 K
winlogon.exe                1552 Console                 0      3,148 K
services.exe                1596 Console                 0      4,732 K
lsass.exe                   1608 Console                 0      6,524 K
ati2evxx.exe                1756 Console                 0      2,728 K
svchost.exe                 1780 Console                 0      5,380 K
svchost.exe                 1848 Console                 0      5,420 K
svchost.exe                 1916 Console                 0     36,032 K
svchost.exe                 1984 Console                 0      4,148 K
svchost.exe                  360 Console                 0      5,188 K
spoolsv.exe                  720 Console                 0      7,848 K
BTNtService.exe              980 Console                 0      2,480 K
bmwebcfg.exe                 992 Console                 0      1,608 K
svchost.exe                 1008 Console                 0      3,648 K
cisvc.exe                   1020 Console                 0      1,008 K
cvpnd.exe                   1048 Console                 0      5,520 K
LSSrvc.exe                  1176 Console                 0      1,832 K
lkcitdl.exe                 1236 Console                 0      5,032 K
lkads.exe                   1964 Console                 0      4,656 K
lktsrv.exe                  2008 Console                 0      4,916 K
FrameworkService.exe        2036 Console                 0      7,764 K
mcshield.exe                 372 Console                 0     30,852 K
vstskmgr.exe                 836 Console                 0      3,568 K
MDM.EXE                     1124 Console                 0      3,060 K
naPrdMgr.exe                1288 Console                 0        932 K
RTProxy.exe                 1720 Console                 0      5,696 K
niSvcLoc.exe                 280 Console                 0      2,740 K
HPZIPM12.EXE                 284 Console                 0      1,908 K
svchost.exe                  872 Console                 0      4,832 K
MXTask.exe                   928 Console                 0      4,600 K
sshd.exe                    2104 Console                 0      4,188 K
tb2launch.exe               2132 Console                 0      6,024 K
TimbuktuRemoteConsole.exe   2272 Console                 0      1,808 K
nipalsm.exe                 2356 Console                 0      3,192 K
nipalsm.exe                 2376 Console                 0      2,980 K
alg.exe                     2852 Console                 0      4,160 K
MXTask.exe                  3840 Console                 0      5,000 K
wuauclt.exe                 4048 Console                 0     23,364 K
ati2evxx.exe                2064 Console                 0      3,352 K
explorer.exe                2200 Console                 0     23,296 K
wmiprvse.exe                2632 Console                 0      5,528 K
atiptaxx.exe                2740 Console                 0      4,788 K
jusched.exe                 2756 Console                 0      2,096 K
HP Wireless Assistant.exe   1784 Console                 0      4,960 K
SynTPLpr.exe                2796 Console                 0      3,036 K
SynTPEnh.exe                2864 Console                 0      4,788 K
hpwuSchd2.exe               3056 Console                 0      2,640 K
qttask.exe                        3076 Console                 0      2,748
K
eabservr.exe                     3088 Console                 0      5,064 K
shstat.exe                         3320 Console                 0        676
K
UpdaterUI.exe                 3372 Console                 0      2,120 K
tbmon.exe                        3380 Console                 0      2,812 K
rundll32.exe                     3220 Console                 0      3,888 K
MDDiskProtect.exe         2400 Console                 0      3,444 K
MACVNTFY.EXE          3752 Console                 0      4,460 K
AcroTray.exe                    2780 Console                 0      3,252 K
minitb2.exe                       3760 Console                 0      5,760
K
aolsoftware.exe                 3864 Console                 0      6,700 K
hpqwmi.exe                       3948 Console                 0      3,812 K
realsched.exe                     3912 Console                 0        224
K
point32.exe                        524 Console                 0      5,340
K
msmsgs.exe                       572 Console                 0      1,672 K
ctfmon.exe                        2072 Console                 0      3,824
K
aports.exe                          2880 Console                 0
4,244 K
BlueSoleil.exe                   3628 Console                 0     10,796 K
aim6.exe                            3508 Console                 0
5,472 K
Ymsgr_tray.exe                 2752 Console                 0      5,864 K
cmd.exe                               480 Console                 0
2,700 K
tasklist.exe                           324 Console                 0
4,840 K
wmiprvse.exe                     3468 Console                 0      5,792 K

C:\Documents and Settings\normal>

Output from Active Ports at start-up

System	4	10.0.1.2	138			LISTEN	UDP	
System	4	10.0.1.2	137			LISTEN	UDP	
System	4	0.0.0.0	445			LISTEN	UDP	
System	4	10.0.1.2	139			LISTEN	TCP	
System	4	0.0.0.0	445			LISTEN	TCP	
niSvcLoc.exe	280	0.0.0.0	3580			LISTEN	TCP
C:\WINDOWS\system32\niSvcLoc.exe
svchost.exe	360	127.0.0.1	1900			LISTEN	UDP
C:\WINDOWS\system32\svchost.exe
spoolsv.exe	720	0.0.0.0	1030			LISTEN	UDP
C:\WINDOWS\system32\spoolsv.exe
cvpnd.exe	1048	127.0.0.1	62514			LISTEN	UDP
C:\Program Files\Cisco Systems\VPN Client\cvpnd.exe
cvpnd.exe	1048	127.0.0.1	62514			LISTEN	TCP
C:\Program Files\Cisco Systems\VPN Client\cvpnd.exe
lkcitdl.exe	1236	0.0.0.0	1029			LISTEN	UDP
C:\WINDOWS\system32\lkcitdl.exe
lkcitdl.exe	1236	0.0.0.0	1027			LISTEN	UDP
C:\WINDOWS\system32\lkcitdl.exe
lsass.exe	1608	0.0.0.0	4500			LISTEN	UDP
C:\WINDOWS\system32\lsass.exe
lsass.exe	1608	0.0.0.0	500			LISTEN	UDP
C:\WINDOWS\system32\lsass.exe
RTProxy.exe	1720	0.0.0.0	1036			LISTEN	TCP
C:\WINDOWS\system32\RTProxy.exe
svchost.exe	1848	0.0.0.0	135			LISTEN	TCP
C:\WINDOWS\system32\svchost.exe
svchost.exe	1916	127.0.0.1	123			LISTEN	UDP
C:\WINDOWS\System32\svchost.exe
lkads.exe	1964	0.0.0.0	2343			LISTEN	UDP
C:\WINDOWS\system32\lkads.exe
svchost.exe	1984	0.0.0.0	1047			LISTEN	UDP
C:\WINDOWS\system32\svchost.exe
lktsrv.exe	2008	0.0.0.0	1028			LISTEN	UDP
C:\WINDOWS\system32\lktsrv.exe
lktsrv.exe	2008	0.0.0.0	1026			LISTEN	UDP
C:\WINDOWS\system32\lktsrv.exe
sshd.exe	2104	127.0.0.1	1038			LISTEN	UDP
C:\cygwin\usr\sbin\sshd.exe
sshd.exe	2104	0.0.0.0	22			LISTEN	TCP
C:\cygwin\usr\sbin\sshd.exe
tb2launch.exe	2132	127.0.0.1	1042	127.0.0.1	1041
ESTABLISHED	TCP	C:\Program Files\Timbuktu Pro\tb2launch.exe
tb2launch.exe	2132	127.0.0.1	1041	127.0.0.1	1042
ESTABLISHED	TCP	C:\Program Files\Timbuktu Pro\tb2launch.exe
tb2launch.exe	2132	127.0.0.1	1040	127.0.0.1	1039
ESTABLISHED	TCP	C:\Program Files\Timbuktu Pro\tb2launch.exe
tb2launch.exe	2132	127.0.0.1	1039	127.0.0.1	1040
ESTABLISHED	TCP	C:\Program Files\Timbuktu Pro\tb2launch.exe
alg.exe	2852	127.0.0.1	1044			LISTEN	TCP
C:\WINDOWS\System32\alg.exe
minitb2.exe	3760	0.0.0.0	407			LISTEN	UDP
C:\Program Files\Timbuktu Pro\minitb2.exe


Output of ps-a taken at a different time.  Sshd running with UID 18.


normal AT RPC ~
$ ps -a
      PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
I    2848       1    2848       2848    0 1005 20:57:34 /usr/bin/bash
     3232       1    3232       3232    ?   18 21:07:53 /usr/sbin/sshd
I     500       1     500       3960    1 1005 21:07:59 /usr/bin/bash
I    2488       1    2488       2488    2 1005 21:30:42 /usr/bin/bash
I     724       1     724        724    3 1005 21:54:20 /usr/bin/bash
I    5148       1    5148       5148    4 1005 21:57:10 /usr/bin/bash
     5072       1    5072       5072    5 1005 22:00:07 /usr/bin/bash
     5640    5072    5640       5668    5 1005 22:00:13 /usr/bin/ps

normal AT RPC ~
$


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