It seems like installing OpenSSH (sshd) on Windows 7 is a bit of a hassle. When I first upgraded to 7 from WinXP, I simply copied across my Cygwin directory and it just worked. However, it was later I realised that it would not let me log in if using public key authentication. So I decided to install it from scratch. I’ve always used Nicholas Fong’s article when installing openssh as the procedure is quick and painless. But this is when I realised Windows 7 requires the sshd user to have extra privileges to get it work properly. The steps in the aforementioned site gets around this creating a new user called cyg_server. Personally, I don’t like having extra users, so I tried to find out how to give myself the same permissions without the need to create a new user.
With these instructions, you can fix the public key authentication problem and run sshd as Administrator or an existing user (even your own user account):
You should have already installed cygwin and openssh by now. If not, what are you waiting for? Christmas? :P
Undo any previous attempts to install the sshd service:
$ net stop sshd
$ cygrunsrv -R sshd
$ net user sshd /DELETE # See note below
$ rm -R /etc/ssh*
$ mkpasswd -cl > /etc/passwd
$ mkgroup --local >