X-Spam-Check-By: sourceware.org Date: Thu, 7 Sep 2006 23:17:43 -0400 (EDT) From: Igor Peshansky Reply-To: cygwin AT cygwin DOT com To: Ron Dozier cc: cygwin AT cygwin DOT com Subject: Re: sshd is running as a service but cygwin and services.mmc thinks it's not In-Reply-To: <000801c6d2ea$cbeb8d30$0201000a@RPC> Message-ID: References: <000801c6d2ea$cbeb8d30$0201000a AT RPC> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, 7 Sep 2006, Ron Dozier wrote: > 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. The fact that you can log in says that sshd is running on the machine. What both Windows and cygrunsrv are trying to tell you is that it's not running *as a service* (meaning a Windows service). > 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. > [snip] > > 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. That's because the sshd process wasn't running yet until you tried starting a service. > 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. Good. > Service was installed using "cygrunsrv -I sshd -p /usr/sbin/sshd -y > tcpip Not good. Is there a reason you didn't simply use ssh-host-config? You're missing the crucial parameter to sshd (or, alternately, cygrunsrv), which actually explains your behavior. > Cygrunsrv is installed as a service. I can login to my laptop from a > Unix host even when no user is logged in. (good) By default, sshd runs in daemon mode, which means it forks off a daemon process and then quits. You either need to tell sshd to not fork off another process, or tell cygrunsrv that the sshd process will quit, and to use the alternate means of communicating Service Control Manager commands to it. I intentionally do not include the actual option values, since this would have happened automatically for you had you used ssh-host-config. I suggest you remove the service and re-run ssh-host-config. > [snip] > 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. Shouting is not healthy. :-) Besides, as explained above, Windows and Cygwin don't claim that sshd is not running -- they only say that the associated *service* is not in the running state... > I CAN'T STOP THE SERVICE, BECAUSE WINDOWS AND CYGWIN THINK IT'S NOT > STARTED. ...and thus you can't stop it. > BUT I CAN STOP sshd with Active Ports. You can kill the sshd process, which is not the same. You could also have done this via the Windows task manager running as the appropriate user, or via the Cygwin "kill" command. In either case, you're killing the *process*, not the *service*. > [snip] > 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. If you have a working "control" machine, I suggest using "cygrunsrv --verbose -Q" to compare the service program settings on the two machines. That would have allowed you to quickly spot the difference. If the above does not solve your problem, please read and follow the Cygwin problem reporting guidelines at , especially the bit that talks about attaching (as an uncompressed text attachment) the output of "cygcheck -svr" on the problem machine. HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com ZZZzz /,`.-'`' -. ;-;;,_ Igor Peshansky, Ph.D. (name changed!) |,4- ) )-,_. ,\ ( `'-' old name: Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte." "But no -- you are no fool; you call yourself a fool, there's proof enough in that!" -- Rostand, "Cyrano de Bergerac" -- 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/