[Cygwin] | [SSHD Setup] | [SSHD Testing] | [Uninstall]

Use the following steps to successfully get OpenSSH working as a server:

  1. Set up your environment for Cygwin. For NT 4 and Windows 2000, this is done by right-clicking on My Computer and choosing Properties. In NT4, it's on the Environment tab. In Windows 2000, it's the Environment Variables on the Advanced tab. Add the following setting to the System Environment:
    • CYGWIN = ntsec tty
    Append the following variable to contain the following:
    • Path : ;C:\Cygwin\bin
    Note that if you are NT/2K on FAT(32), the ntsec option for the CYGWIN variable won't help you much. In these cases, just set CYGWIN to "tty". (Note: Through email, I've been notified that having CYGWIN=ntsec actually does made a difference on FAT(32) systems. Geoffrey Hoo)

  2. Download the Cygwin Setup Program into a temporary folder like C:\CygwinInstall.

  3. Run "C:\CygwinInstall\Setup.exe", choose " Install from Internet ", choose a suitable mirror (I like "").

  4. Now choose the packages you want to install. Click on the "+" next to "Admin" to expand it. Click on the word "Skip" next to the word cygrunsrv to install the NT/Win2k/XP Cygwin Service Initiator. Install cygwin-doc from "Doc", nano and/or vim from "Editors" and openssh from "Net".

  5. [Optional] After Setup is complete, I like to make a couple of changes to the default installation: - Download and install, into /etc. - Change the Cygwin icons so that, instead of pointing to cygwin.bat, they point to "c:\cygwin\bin\bash.exe --login -i" and start in "c:\cygwin\bin"

  6. NOTE: Unless specified otherwise, run the following commands within the Cygwin Bash Shell installed in your Start Menu.

  7. Now, you'll want to configure sshd. This is MUCH simpler than it used to be.
    Run "ssh-host-config -y" to set it up. This step will create necessary configuration files, a priviledge separation user and necessary directories. When prompted with "CYGWIN=" type what you set CYGWIN to in step 1 (tty ntsec).

  8. You will probably want to change permissions and ownership on some files:
    • cd /; chmod -R og-w .
    • chmod og+w /tmp
    • touch /var/log/sshd.log
    • chown system:system /var/log/sshd.log /var/empty /etc/ssh_h*
    • chmod 755 /var/empty

  9. Now you are ready to start the service: "cygrunsrv -S sshd"

  10. Test the service by running "ssh localhost"

Please note that previously, I had instructions that included running a custom fix permissions script. I have not tested the script with newer versions of OpenSSH and therefore have left that information out of the instructions above. If you have any questions, please direct them to the mailing list

If, at this point, you are unable to connect to your sshd server, join my SSH-L mailing list for extra help.

If your ultimate goal (like mine was) is to connect to the SSH server with a GUI client like Putty or Van Dyke's SecureCRT, now try that. At this point, also test connecting to your SSH server from a different machine to ensure network connectivity.

If this is unclear or if you have any questions, join my SSH-L mailing list.


Valid HTML 4.01!   Made with GNU Vim   Powered by:
[Powered by Apache]   [Powered by OpenBSD]