Andrew Jorgensen

It's better than bad, it's good!

Cygwin OpenSSH

Setting up OpenSSH on a windows machine used to be difficult (a few years ago), but it’s really not too hard now. We did run into some trouble that appeared to be caused by a FAT32 filesystem, but more on that later.

Installation

  1. Download and run Cygwin’s setup.exe.
  2. Follow the wizard until you get to the package selection dialog. (Defaults are good.)
  3. Select openssh (it’s under “Net”) and any other software you need, rsync for instance. Don’t deselect anything, the default selection set is pretty much just the base installation.
  4. Tell it to install, and finish the wizard.

SSH Service Setup

  1. Open a Cygwin bash prompt from the icon on the desktop or the “start” menu.
  2. Run ssh-host-config.
    • When asked what to set the CYGWIN variable to: ntsec tty. More info about this variable here.
    • Accept the defaults and say “yes” to everything, unless you know better. Yes, you want to use privilege separation, yes, you want to create a user for the service, etc.
  3. Warning: On some hosts (probably those using FAT32) you need an extra step!
    • cygrunsrv --stop sshd
    • cygrunsrv --remove sshd
    • cygrunsrv --install sshd --disp "CYGWIN sshd" --path /usr/sbin/sshd --args "-D" --env "CYGWIN=ntsec tty"
    • cygrunsrv --start sshd
    • This extra step solves the cygcrypt-0.dll not found problem.

Thanks to Thomas Hennemann for finding the solution despite a lot of disinterest in the problem.