Subject: Proposed changes to ssh-host-config (was: SSHD does not start upon reboot, but manual is ok.)
From: "Jeroen W. Pluimers \(All I'M\)" <[email-masked]>
To: [email-masked]
Date: Mon, 29 Apr 2002 17:45:34 +0200
Newsgroups: gmane.os.cygwin

"Lassi A. Tuura" <[email-masked]> wrote in message
news:[email-masked]...
> > What could prohibit the SSHD to start at boot-time?
> > Is there some form of dependency?

> Your sshd probably needs a dependency on other services; the names
> aren't obvious to the uninitiated, but need to be up for sshd to start
> (they are running by the time you start manually).

I was asuming something like that.
It seems to work fine on a regular PC, but not on a laptop.
I presume this is because the laptop uses a different initialisation
sequence.

> The services required can vary depending on your system configuration.
> I forget the names, look for "Tcpip", "LanmanWorkstation" or "Browser".
> More details in the archives.

I have looked in the archives, and tried various dependency settings.
"LanmanWorkstation" gets translated into "Browser" and works.
"Server" does not work, it generates errors.
"LanmanServer" gets translated into "Server" and works.
"Tcpip" works too, and I think it is the preferred solution, as I can't
imagine a system running sshd without TCP/IP.

During the testing, I found out that sshd barfs when the permissions on some
files /etc/ssh*key are wrong.
It seems that ssh-host-config usually creates these files with 777 as
rights, in stead of 600.

Based on both experiences, here are some proposed changes to the
ssh-host-config script:

##original:
##    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a -D -e
"CYGWIN=${_cygwin}"
##solution 1:  (tcpip dependency - preferred)
    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -y
tcpip -a -D -e "CYGWIN=${_cygwin}"
##solution 2: works (lanmanworkstation dependency)
##    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -y
lanmanworkstation -a -D -e "CYGWIN=${_cygwin}"
##solution 3:  (lanmanserver dependency)
##    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -y
lanmanserver -a -D -e "CYGWIN=${_cygwin}"
    then
      chown system /etc/ssh*
## Make sure that sshd does not barf on permissions:
      chmod 600 /etc/ssh*key

Please shoot at it.

--jeroen

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