Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

I followed the guide from http://www.noah.org/ssh/cygwin-sshd.html 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

8 Answers 8

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-1.7.2.0/cygwin1.dll."

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

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:

http://h30499.www3.hp.com/t5/Windows-Server-2008/Installing-OpenSSH-on-Windows-server-2008/td-p/4777839#.U0cmzle2wuI

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

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
    .....run 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

On a client system I found a program called RDPlus (www.rdplus.com.au) 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 0.0.0.0 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

Your Answer

 
discard

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.