Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Cygwin and sshd on Windows 7 but I'm not able to make it work.

I followed the guide from but I still get:

$ cygrunsrv -S sshd
cygrunsrv: Error starting a service: QueryServiceStatus:  Win32 error 1062:
The service has not been started.

Configuration details:

  • Windows 7 in a domain running with a domain user that has local administrative priviledges
  • netstat -a -b reports nothing running on port 22
  • C:\cygwin\var\log\sshd.log is empty
  • After I installed cygwin and sshd, I run ssh-host-config -y
  • Already tried to add SYSTEM account to the 3 directories, no change.
  • Already tried a full system reboot, no change

Update: Windows logs complains about Possible duplicate cygwin1.dll

share|improve this question
Have you solved this yet? I am having similar problems? – Lord Loh. Feb 18 '12 at 21:21
i've foudn i can reproduce this error by going to services.msc cygwin sshd logon tab, and switching between local account(cyg_server), and system. each time there's a change, it needs an ssh-host-config -y done from a command prompt started via right click run as administrator, or from a runas /user:Administrator c:\windows\system32\cmd.exe That ssh-host-config -y must precede the net start sshd / cygrunsrv -S sshd. And if it doesn't work from a 'run as admin..' try from a runas/user:... cmd prompt. – barlop May 13 '15 at 2:46

10 Answers 10

Thanks, Your update was the resolution - for anyone else out there, there is a recipe #3 against Win32 error 1062 at Cygwin startup:

1) Check the Application Event log, see if there are "Information"-level events there with something like: "sshd: PID : Possible duplicate cygwin1.dll:"

Find that silly duplicate at the specified location and rename it or get rid of it from the path somehow. Mine was at "/cygdrive/c/Program Files (x86)/socat-"

Boo, socat! Apparently they engage in 3PP. Didn't even know socat was on my system, apparently it came as a part of some other installation. I found 2 other people in the cygwin mailing lists having suffered from the duplicate-dll problem.

share|improve this answer

I had (almost) the same effect and an analogous solution: Application log showed a duplicate file

Possible duplicate cygwin1.dll: /cygdrive/c/dakota/bin/cygwin1.dll..

from my dakota installation. Renaming this dll did the trick. Thank you!

share|improve this answer

I had some privilege separation problem. In this case adding a line to /etc/passwd file solved the problem.

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

share|improve this answer

Thank you @HopelessN00b, @user155148, @Algomorph a combination of your solutions got me going.

The Crux

I had two problems:

  1. Duplicate cygwin1.dll files.
  2. /var/log/sshd.log: "Privilege separation user sshd does not exist"

My Fix

  1. Deal with the bloody duplicate pickle files:

    cd /cygdrive/c/Program\ Files\ \(x86\)/cwRsync/bin
    mv cygwin1.dll cygwin1_.dll
  2. Added a user by editing /etc/passwd and adding the following line:

    sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

Note that the username 'sshd' came from /var/log/sshd.log.

GAD what a pain in the arse this is!

I did find one other resource, this one a bit more verbose and from Oracle

In a nutshell, if you are having greif:

  1. Run each of these steps ONE. AT. A. BLOODY. TIME.
    ...make the fix cygrunsrv -S sshd
    .......curse profusely
  2. Check the Windoze event logs.
    ...Do you have duplicate dll files??
  3. Take a look at /var/log/sshd.log
    ...Do you have /etc/passwd probs?
share|improve this answer

For me it turned out to be a compatibility issue. I was trying to run it in Win7. Fixed by right clicking the file in explorer, going to compatibility and setting compatibility to Windows Server 2003. Worked fine after that.

Found the solution here:

Note that my issue was related specifically to trying to launch OpenSSH Server which uses a light version of Cygwin I guess.

share|improve this answer

The /etc/passwd response was very close, but the UID 74 was specific to his installation.

instead use this cygwin command to grab the correct UID.

mkpasswd -l -u sshd >> /etc/passwd

share|improve this answer

This seems to be caused by ANY error with the sshd server - in my case it barfed on /etc/ssh_host_rsa_key perms - should be 0600. look in /var/log/sshd or similar.

share|improve this answer

On a client system I found a program called RDPlus ( running an SSH tunneling option on port 22 that I had to disable before Cygwin sshd would start. From CMD.EXE, 'netstat -abo' pointed at this process after finding an 'Bind to port 22 on failed' error in the Application Event Log. The 'o' option will show the PID which can be found in Task Manager.

To disable this run the RDPlus admin tool, go to the Web tab and disable SSH Tunneling.

share|improve this answer

Someone posted this on another Stack Exchange question, but in case you have a empty file in /var/log/sshd, you should try /usr/sbin/sshd. This will output the errors you didn't get in the log.

For me, unistalling the sshd services, rebooting and then re-running ssh-host-config, while following these instructions, helped (ls -l /var/etc told me that in my first attempt, the empty folder was owned by SYSTEM, which makes sense, since I followed this tutorial previously. However, this way, I got a "/var/empty must be owned by root and not group or world-writable" error).

share|improve this answer

I was using Cntlm (NTLM authentication proxy) which contains cygwin1.dll too, avoidance of such duplication resolved the issue.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.