Cygwin sshd

Cygwin openssh Today I needed to set up an openssh server on a Windows box. Why? In this case, for two reasons. I wanted to use scp to ship files securely to the box. And I wanted to be able to tweak some configuration files remotely.

There are a bunch of options for getting a Win32 sshd going. They include: build from source; use a standalone binary package; go with the openssh that's part of the Cygwin system. I went with Cygwin, because its Win32 setup program and package installer have, in recent years, become extremely powerful, flexible, and easy to use.

I grabbed the default kit plus the openssh package, and then followed the instructions here. As smooth as this stuff has gotten, there's always still some kind of glitch, almost invariably permissions-related. And sure enough, the sshd service wouldn't start. I rechecked the instructions and found the culprit:

chown system:system /var/log/sshd.log /var/empty /etc/ssh_h*
There were two options. Either let sshd log in as SYSTEM, or change ownership on those files to sshd_server, the account used by cygwin sshd. I did the latter.

It's amazing how these kinds of permissions glitches are so common -- on all platforms -- and yet so hard to pin down and untangle. Google showed me that a bunch of other people had run into the snag I encountered. Recommendations included using verbose NTFS auditing, or the Filemon utility, to debug the problem. Fair enough, but when you are in installation mode, why can't your OS -- any OS -- be smarter about correlating failed permissions with the software you just installed?

Anyway, that's not Cygwin's fault. It's a great resource that just keeps on getting better.


Former URL: http://weblog.infoworld.com/udell/2003/12/17.html#a871