This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems using sshd as a service


> On Wed, Dec 04, 2002 at 10:53:52AM +0100, David Brown wrote:
> > > On Wed, Dec 04, 2002 at 10:33:41AM +0100, David Brown wrote:
> > > > I am trying to get sshd to run as a service on my W2K SP2 machine.
I
> > have
> > > > got sshd set up properly (as far as I know), with all the keys and
files
> > it
> > > > needs.  If I start a cygwin bash shell and type "/usr/sbin/sshd",
then
> > the
> > > > server starts fine and issues no errors or warnings.  From another
PC on
> > the
> > > > network, I can ssh in to this PC.  In other words, sshd is working
> > > > perfectly.
> > > >
> > > > However, when I install it as a service with
> > > >
> > > >     cygrunsrv -I sshd -p /usr/sbin/sshd
> > > >
> > > > and then try to start the service, either with cygrunsrv or from the
> > Control
> > > > Panel, I get:
> > > >
> > > >     cygrunsrv -S sshd
> > > > cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error
> > 1062:
> > > > The service has not been started.
> > >
> > > Are your mounts type system or user ? system should be better.
> > >
> >
> > $ mount
> > D:\cygwin\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type
system
> > (binmode)
> > D:\cygwin\bin on /usr/bin type system (binmode)
> > D:\cygwin\lib on /usr/lib type system (binmode)
> > D:\cygwin on / type system (binmode)
> > c: on /cygdrive/c type user (binmode,noumount)
> > d: on /cygdrive/d type user (binmode,noumount)
> > e: on /cygdrive/e type user (binmode,noumount)
> > m: on /cygdrive/m type user (binmode,noumount)
> > p: on /cygdrive/p type user (binmode,noumount)
> > q: on /cygdrive/q type user (binmode,noumount)
> >
> > So it looks like the basic cygwin mounts are system, but the mappings to
> > windows drives are user.  I presume sshd only access files through the
basic
> > mounts, so they should be ok.  There is also no problem if I start sshd
from
> > the bash shell - perhaps this is something to do with the user that
starts
> > it, since services are owned/started by system?
>
> Maybe it's this, mounts seem to be o.k.
>
>
> Gruss Olaf Föllinger
>
> P.S.: Please answer on the list so that other can read the answers too.
>

Sorry about that - I forgot to check the "reply-to" setting for this mailing
list (most of the lists I use regularly have reply-to set to the list rather
than the poster.  I've just recently learned why many list administrators
see that as a bad idea, and I agree with that - yet I *still* managed to
forget it).




It turns out that what I had to do was install the service with
    cygrunsrv -I sshd -p /usr/sbin/sshd -a "-D"

I also changed ownership of /var/empty to SYSTEM, but I don't think that was
the problem (since the directory was world writeable, and I also have been
running without ntsec).

I'm not too worried about security here, since the company's internal
network is pretty well protected from the outside, and I know that if I
can't figure things out, then there is no one else in our company who can!

mvh.

David






--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]