Windows Port of ssh/sshd

If you have any comments or questions about this documentation, please e-mail winathena-suggestions

News

These instructions now use the latest cygwin distribution. These include OpenSSH ssh and sshd.

Installation

First, make sure that you are logged in as a local system administrator.

Next, install cygwin. The installation program can be found at http://www.cygwin.com/setup.exe. More information about cygwin can be found at http://www.cygwin.com/.

When you install, you can go ahead and install all of the packages. (That should be the default.) You do not need to select the sources for installation.

When it asks whether to use DOS or Unix-style text files, say Unix. Tell the setup program to install a shortcut.

Once the install is complete, start up the cygwin shell from the shortcut. Then, at the bash command prompt, do:

ssh-keygen -b 1024 -f /etc/ssh_host_key -N ''

(Note the 2 single quotes after the -N above.)

Then, to start up the sshd daemon, do (still as a system administrator and running bash):

/usr/sbin/sshd

Starting up sshd directly

If you want to create a shortcut or batch file to start up sshd directly without first having to start up bash then sshd, just use this command:

bash --login /usr/sbin/sshd

If you don't want sshd to go to the background, use:

bash --login "/usr/sbin/sshd -D"

Starting up sshd as a service

If you want to run sshd as a service, you can use SRVANY from the Windows NT/2000 resource kit. You should use the command line:

bash --login "/usr/sbin/sshd -D"

Adding users

If the users on your system change (i.e., you add or remove accounts using the user manager), you might need to start up a cygwin command prompt and run the following:

Caveats

This has not been tested in a domain setup. If you have any feedback on that, please send e-mail to the address at the top of this page.

When you log in, you get a bash shell.

If you need to kill sshd, you will need to use the task manager.

It may be the case that you can end up with orphaned processes. If so, try not to start processes remotely if you can help it.

If logging in is not working, you can try running sshd in debug mode by adding the -d option to the sshd command.

Other Information

The old version of this page is here.

You might find other useful ssh/sshd on Windows information at: