$ cygrunsrv.exe -S sshd
cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062:
Cannot start sshd.
$ cygrunsrv.exe -I sshd –path /usr/sbin/sshd.exe
cygrunsrv: Error installing a service: OpenSCManager: Win32 error 5:
Access is denied.
cygrunsrv: Error installing a service: OpenSCManager: Win32 error 5:
Access is denied.
People seem to suggest permission problems. I haven’t solved the problem yet.
January 23, 2010 at 1:30 am
I think the user account you are logging on as does not have permissions to install new services (Even though my user account is a member of the Administrators group)
I ran into this problem on a Windows 2008 system and wasted a bunch of time trying to figure out how to grant myself that permission.
I gave up on that route and was able to solve it by right-clicking on the shortcut for starting the Command Prompt and selecting “Run as Administrator”.
I imagine you could also solve this by actually logging on as the Administrator account.
October 15, 2011 at 1:30 pm
Hy,
I am using Windows x64 ServicePack 1, and cygwin-rsyncd-2.6.8_0. It works using “Run as Admin”
Thanks.
October 18, 2011 at 9:38 am
Thanks, this helped!
September 27, 2010 at 8:07 pm
I tried running a service — rsync in my case — as a member of the Administrative group. The batch file failed: Access denied.
Then I ran the same batch file after right clicking on Command Prompt and selecting “Run as Administrator”. The service is now registered in Services (Local) but will not not start. This is an improvement but not sufficient. The new error is “Windows could not start the rsyncd service on Local Computer. Error 1067: The process terminated unexpectedly.”
October 5, 2010 at 8:00 am
I think I maybe having a similar problem. I have two programs giving me the same error message about openscmanager; “OpenSCManager: Win32 error 5”. (Cygwin and Wipfw) Also, I am using Windows 7 64 bit, and both programs are listed as being conpatible.
I have tried running them as administrator, clearing out Registry errors, running other scans, and a few other things… nothing seems to work!
Are there any other ideas!?
December 20, 2010 at 4:47 pm
I’ve spent a while looking at this and other cygrunsrv / cron problems. If you still have the problem I’ve written up my findings here.
http://www.davidjnice.com/articles/cygwin_cron-service.html
January 28, 2013 at 3:08 am
I looked at /var/log/sshd.log and I got info on the permissions of the host keys being set too high. “chmod go-rw *key” in /etc did it for me. Also gave full control to S
YSTEM user for /cygwin, /cygwin/var and /cygwin/var/log. In windows 8 I got an error in doing this saying that objects in container weren’t accepted. This can be ignored safely as the access controls otherwise were accepted.