Proposed changes to ssh-host-config (was: SSHD does not start upon reboot, but manual is ok.)

Jeroen W. Pluimers (All I'M)
Mon Apr 29 11:14:00 GMT 2002

"Lassi A. Tuura" <> wrote in message
> > 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

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

##    if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a -D -e
##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}"
      chown system /etc/ssh*
## Make sure that sshd does not barf on permissions:
      chmod 600 /etc/ssh*key

Please shoot at it.


Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list