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]

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



"Lassi A. Tuura" <lassi.tuura@cern.ch> wrote in message
3CCD160C.41DBDA8D@cern.ch">news:3CCD160C.41DBDA8D@cern.ch...
> > 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/


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