Making Cygwin SSH server for Windows

One of the great things about using Cygwin SSHD is you also have access to the full suite of Cygwin tools like Octave, Imagemagick, etc.

note, I won’t get into security setting here–but at least consider using Public Key Authentication — it’s much stronger than any human usable keyboard password.

1) run “setup-x86_64.exe” and install “openssh”
2) start Cygwin64 using “Run as Administrator” and type ssh-host-config
3) here are some suggested answers to the configuration script questions:
Priviledge separation? YES
sshd as service? YES
value of CYGWIN for daemon? (just press Enter key, don’t type anything)
use a different name? no (you want to use cyg_server)
4) in Cygwin64, type cygrunsrv -S sshd
5) now try to login to your SSH server from another PC. Under services.msc you should see the Status “started” for service “CYGWIN sshd”, and under the General tab the “path to executable” should be something like
6) to configure your SSH server (optional), type in Cygwin64:
nano /etc/sshd_config
to make the changes take effect, type
cygrunsrv -E sshd
cygrunsrv -S sshd

If you get “system error 1069 has occurred. The service did not start due to a logon failure”, check the password on your “priviledged server” cyg_server — maybe you typed it wrong.

Removing sshd daemon in Cygwin

One reason you might want to disable/remove the sshd daemon is upgrading from 32-bit Cygwin to 64-bit Cygwin

WARNING: This procedure disables SSH access to your PC. You will have to have another means (e.g. physically being at the keyboard or RDP directly on port 3389) to access the PC again!

To disable SSHD server on Cygwin:
1) open Cygwin using “Run As Adminstrator”, and type:

cygrunsrv -E sshd
cygrunsrv -R sshd

2) reboot and verify that you CAN’T connect to your former SSH server. You won’t see “CYGWIN sshd” in services.msc anymore, either.