I'm attempting to set up OpenSSH on a bunch of Windows Server 2003 machines in an automated fashion. My goal is to be able to do so using a single version of Cygwin installed on a network drive instead of manually installing it on each machine.

I can install cygwin just fine, but start running into problems when I try to run ssh-host-config.

1 Answer
1

First up is the difference between Cygwin's posix-y view of permissions and ownership vs Windows.
You'll want to read Using Windows security in Cygwin. The ???????? is displayed because the files are owned by a user that is not defined on the local machine. If you're in a domain, you can probably run mkpasswd and mkdroup and using the output to create appropriate /etc/passwd and /etc/groups. However, they will only include the machine-specific accounts of the host where they were created. Which segues nicely to the second issue...

Cygwin saves most of its configuration settings in or under /etc. So sharing /etc across multiple hosts is very difficult. Likewise, most Cygwin processes will assume /tmp and /var are also machine specific.

You might be able to get this to work by creating local directories on each machine, such as: c:\cygwin\etc, c:\cygwin\tmp, and c:\cygwin\var. You will need to populate etc and var with the expected files and directories. Then you'll need to create a /etc/fstab that brings all of these together into a complete filesystem. You'll want to read Mapping path names for more on that.

Also keep in mind that any time your network drive is unavailable, any running Cygwin processes may hang, crash, or just behave oddly.

Thank you - I have some homework to do before I'll be able to get this to work but your answer points me in the right direction.
–
dpettersJul 6 '11 at 16:08

Yeah, this seems like a bad solution. Ideally, you would script some sort of installer for Cygwin and deploy that. Having said that, I don't believe that the setup.exe for Cygwin can be scripted, or read an answer file, etc. You could wrap it in an MSI using a packager, I suppose.
–
mfinniJul 6 '11 at 16:17