I had this problem and resolved it.
Initially I followed the answer from Константин Брызгалов and was able to login with a password, but could not get public key authentication working. (I had created a local cyg_server administrator account manually.)
On further investigation, I was reading this page and it said to avoid having both a domain and a local account. I checked and I did have both; apparently someone else in my organization is running a cygwin server and had already created a cyg_server on the domain, which was getting confused with my local account.
I deleted my local cyg_server account, uninstalled the sshd service, and reinstalled as described on that page, and everything worked perfectly out of the box. The trick was to say "no" to using the existing cyg_server account, and tell ssh-host-config to create a "cyg_server1" account. It created a local account and set everything up correctly. Specifically:
- cygrunsrv --stop sshd
- cygrunsrv --remove sshd
- Ctrl Panel > User Accounts > Manager User Accounts > (delete local cyg_server account)
- mkpasswd -l -d >/etc/passwd
- mkgroup -l -d >/etc/group
- ssh-host-config
- overwrite = yes
- strict = yes
- CYGWIN = ntsec
- user to run = cyg_server1
- password = {...}
Checking user accounts you will see that cyg_server1 is indeed a local account but has additional setup.
.bashrc
of the user profile you are connecting to.