This is the mail archive of the cygwin 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]

Does /usr/bin/ssh-host-config need to be updated?


I've seen other posts about sshd upgrade problems so I thought I'd post
my own experience in getting things working. In the end I had to change
/usr/bin/ssh-host-config slightly so I wanted to share what I found. I
only needed to do this on one Windows XP laptop, but not on other
Windows 2000 or Windows XP machines that I have using sshd on a daily
basis.

My old Windows XP laptop has been running sshd from cygwin for I'm
guessing around 2 years, but had not been been update via setup.exe for
at least several months if not most of a year. I recently wanted to run
tetex so I added that package, with the side effect of upgrading just
about everything else in my world, including the main cygwin package,
bash, etc.

After the download and install phases, a number of post install scripts
had serious errors about missing entry points in a dll, I'm assuming
because of the new cygwin1.dll. I shuddered, but I've had these before
so I pressed on. 

After rebooting to finishing installation for files that were in use,
sshd failed to start with a missing cygcrypt-0.dll, which I was notified
about via a windows alert box. The file did exist in /usr/bin and setup
said the package was installed, but the scary entry point problem caused
me simply try to reinstall all from setup.exe. Even after this sshd
still failed to start with the same error.

I remember vaguely a while back that cygrunsrv options needed to change
for sshd. So I actually had tried the strategy Brian Dessent recommended
in this post before I even saw his post this evening:

  Brian Dessent writes Re: sshd crahes; ssh instal fails
  http://www.cygwin.com/ml/cygwin/2005-12/msg00193.html

    If you cannot figure out from the above what the problem is, I suggest
    you remove all traces of the sshd service and re-run ssh-host-config. 
    To do this:

    $ cygrunsrv --remove sshd
    $ rm -rf /etc/{ssh_host_*,sshd_config} /var/{empty,run/sshd*,log/sshd*}
    $ ssh-host-config

    If you get any permission denied errors at the rm step you'll need to
    chown the files before deleting them.

    Brian

However, that did not fix things, I still received the error about the
missing cygcrypt-0.dll. I just found this related post which did address
the problem:

  Thomas Hennemann solved: cygcrypt-0.dll not found
  http://www.cygwin.com/ml/cygwin/2005-12/msg00095.html

    Finally STFW I came across this advice:

    "Reinstalling sshd service in windows
    This one was a bit painful as I didn't want to mess with the pre-existing configuration of the key files. Installation required a small modification to the standard installation options.

    cygrunsrv --install sshd --path '/usr/sbin/sshd' --env 'PATH=/bin;/sbin' --env 'CYGWIN=ntsec tty' -a -D

    You need to use the cygwin --path item, otherwise the service won't start correctly (sshd needs to be executed with an absolute path). The env flags are there to allow the service to start, otherwise you end up with an annoying: cygcrypt-0.dll cannot be found error. The CYGWIN environment was there because otherwise it doesn't work correctly. the -D is for daemon mode."

    (Source: http://www.petesh.com/archives/2005/08/reinstalling_sshd_service_in_w.html) which solved the issue.

    So since the problem is solved I cannot provide more info like log data etc.
    If anyone has a good guess what actually might have went wrong, please come forward ;-)

So I added the --env 'PATH=/bin;/sbin' to the cygrunsrv line in
/usr/bin/ssh-host-config and now sshd is running again as a service on
Windows XP. 

I have attached my cygcheck.out for reference if anyone is curious...

-bri

Attachment: cygcheck.out
Description: Binary data

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

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