Site Navigation

Oct 21, 2014

Install OpenSSH Server on Windows using Cygwin

Linux Logo

SSH is the best utility ever. With it you can remotely and securely log into systems. Plus, it enables the easy transfer and synchronization of files. It works great on Linux and OS X, but what about Windows? It turns out, if you install Cygwin, it is not that tough to enable.

The first step is to, of course, install Cygwin. That is not covered in this post. But it is pretty straightforward. Just make sure that OpenSSH is selected when you do the installation.

Once Cygwin is installed, follow these steps.

  1. Modify 2 environment variables. On Windows 7, select Start -> All Programs -> Computer. Click on System Properties in the menu. Select Advanced System Settings in the left panel. Then click the Environment Variables button. This should allow you to set two system wide variables.
    1. CYGWIN=ntsec tty
    2. Add the following directory to the PATH variable. `;c:\cygwin64\bin’
  2. Open a Cygwin window as Administrator. You can do this from the main start menu or by holding Shift and Right-Clicking the Cygwin icon in the taskbar.
  3. Assuming you have Administrator rights, at the prompt type: ssh-host-config -y.

    This should configure the sshd daemon for you. If the script asks you to set CYGWIN= enter ntsec tty

  4. To start the sshd service type: cygrunsrv --start sshd

Now ssh and its related utilities can be used to log into this Windows machine. Since sshd is installed as a service, Windows should automatically start the service on the next restart. Enjoy!

Post a Comment

Favorite Links Feed