X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <47A1E712.8080306@cygwin.com>
Date: Thu, 31 Jan 2008 10:19:46 -0500
From: "Larry Hall (Cygwin)" <reply-to-list-only-lh@cygwin.com>
Reply-To: cygwin@cygwin.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20070505 Remi/2.0.0.0-3.fc4.remi Thunderbird/2.0.0.0 Mnenhy/0.7.5.0
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Running Cygwin in background.
References: <15181008.post@talk.nabble.com> <4a89b8680801300509u41f96dbak15282443d78f6740@mail.gmail.com> <15195201.post@talk.nabble.com> <47A11F26.4000703@cygwin.com> <15198503.post@talk.nabble.com>
In-Reply-To: <15198503.post@talk.nabble.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Jason has hit the high points but I thought I'd reply to fill in a few other
areas.

jrtayloriv wrote:
> Sorry, I am not used to Windows at all -- I've only been using Linux for the
> past several years and I've forgotten about a lot of things. 

Then you should feel at home in Cygwin.  The concepts are very close in most
regards.

> Because of this, it seems that I am having trouble asking the right
> question...
> 
> I am talking about how to get Cygwin itself to run in the background. Once I
> start up the Cygwin shell, I am able to run SSH as a background service
> within Cygwin. But when I close the Cygwin shell, I loose the SSH server
> running within it.
> 
> What I need is information on how to run ***CYGWIN*** as a background
> service, so that there is no Cygwin window open, but the services that are
> running in Cygwin (in this case sshd) are still there. Do I even need to run
> Cygwin for this? Can I just run cygwin's sshd from windows?

I think Jason has covered this.  You are actually not running the SSH server
as a service at all.  Running it in the background is not the same as
running it as a service, as you have noticed.  Also, since you have been
running it directly from the command-line, you have now set ownership and
permissions on various files and directories the SSH server uses.  These are
now tuned for the user you ran it as.  This means three things:

   1. You won't be able to run the SSH server as a service under any other
      user without resetting all these files/directories.

   2. Since 'ssh-host-config' is set up to create a service for the SSH
      server using the SYSTEM or sshd-server user, you may find that running
      this configuration script no longer gets you a working SSH server
      service (see 1).

   3. While it is possible and permissible to run the SSH server as a service
      under any user, you loose the ability to login with public key
      authentication as any user other than the one the service is running
      under.

Depending on how important this ability is and how willing you are to look
through the archives for recipes on how to reset permissions and owners on
these files and directories, you may find it preferable to just wipe Cygwin
from your system and re-install.  You can then use the supplied scripts to
quickly and easily configure your SSH server the way you want.  Again, the
openssh readme that a number of people have pointed you to is good and
important reading for you, as well as the Cygwin Users Guide.

> I do know what the 'Run' menu is in Windows. I also found information about
> Cygserver in the online documentation -- is this what I need? Are you trying
> to tell me to use the Run menu with 'cygrunsrv.exe' ? Or are you telling me
> to run sshd from 'Run' menu? 

No, not at all.  I was referring to '/usr/bin/run' which hides the console
of console apps when run directly from the Windows Explorer, for example.
'cygrunsrv' is similar to 'service' under Linux.  It allows you to start,
stop, install, and remove services, among other things.  'ssh-host-config'
uses it.




-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
216 Dalton Rd.                          (508) 893-9889 - FAX
Holliston, MA 01746

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

