Note that this blog post has been archived. Information may be out of date or incorrect.

Cygwin- Running an sshd on Windows 7

Currently I am writing a build script for a UNIX application which needs to be built for Windows using the Cygwin environment. I quickly got tired of working inside the default Cygwin window (which doesn’t even have proper copy & paste), so I installed a SSH server to work on the Cygwin environment remotely:

  1. First of all, you need to install the SSH package using the Cygwin installer. If you already installed Cygwin don’t worry, just re-run the installer and you’ll be fine. When you reach the “Select Packages” section, just enter ssh into the search field, open the “Net” section and select the “openssh” package.

  2. Now make sure that your Cygwin shell is started in administrative mode, by right-clicking the Cygwin icon and selecting Run as administrator.

  3. In your shell, run ssh-host-config -y which will create the necessary configuration files for your SSH server.

  4. Set a password for your account (which you will connect to via SSH) by running passwd. If you are unsure which is your username, just run whoami.

  5. Now you can start your server by running cygrunsrv --start sshd