Installing OpenSSH server on a Windows box

0.00 avg. rating (0% score) - 0 votes

An SSH server can be handy on a Windows machine, too. Cygwin comes with OpenSSH, and provides a lot of useful tools which you can use over the SSH connection. Here’s how to install Cygwin and OpenSSH server on a Windows machine.

Install Cygwin. Make sure you also install OpenSSH under the Net category. You can download the installer from here:

http://www.cygwin.com/setup.exe

To successfully run OpenSSH on a Windows 2003 Server, you must create a new user account for it. This is because the SYSTEM account, which is the default when installing OpenSSH as a service, does not have the “Create a token object” right, which is needed for public key authentication. Luckily, the ssh-host-config command will create a user for you, if you wish. Just remember to select “yes” in the following prompts.

In fact, two user accounts are created in the script below. The other one is for privilege separation, which will make your installation a bit more secure. There’s no reason not to enable it.

If you are installing OpenSSH on an Active Directory domain controller, the user accounts will be created in Active Directory. This is because a domain controller does not have a separate local user database, but the local user database is a copy of AD itself. Remember this if you are going to install OpenSSH on more than one DC. On the second installation, the user accounts are already created!

You should now have a new service, called “CYGWIN sshd”, installed. It doesn’t start automatically, so you must start it either from the Windows Services MMC Console or from the command line with the command “net start sshd”.

Leave a Reply