1

I am using cygwin run sshd. But now the sshd is not running as a service. When I start the service using 'net start sshd', Message comes like, "the cygwin sshd service could not be started.The service did not report an error. More help is available by typing NET HELPMSG 3534" and if run using 'cygrunsrv -S sshd' the error comes like "Error starting a service. Query service status:win32 error 1062"

I have removed cygwin completely by deleting its services, server and registry. And installed again, but sshd is not running as a service.

can i have the solution for this?

2
  • try from an administrative cmd prompt if u havent already, and try net stop sshd before net start sshd.
    – barlop
    Commented Sep 29, 2015 at 12:02
  • and state how you removed "removed cygwin completely by deleting its services, server and registry". And don't confuse Cygwin with ssh within it. Cygwin itself has no services. So state what deletions you made. as it may be of interest. But there's no need to remove cygwin to fix ssh. At most you'd want to remove ssh to reinstall ssh.
    – barlop
    Commented Sep 29, 2015 at 12:04

2 Answers 2

1

Error starting a service. Query service status:win32 error 1062

Sometimes you get a sshd/cygrunsrv service error after trying to run the service.

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

There can be a couple of causes for this. The following may fix the problem (this is not an option on XP Home).

Solution 1.

You may have an old or corrupt installation of Cygwin. Try reinstalling.

The following may also help:

  1. cygrunsrv -R sshd
  2. REBOOT (or use the Task Manager to kill all instances of sshd that may be running in the background)
  3. run ssh-host-config -y again.

This seemed to help on a few systems I worked on.

Solution 2.

Open an explorer window and use the "Properties | Security" dialog and explicitly add "Full Control" for the SYSTEM user to the following directories:

C:\Cygwin
C:\Cygwin\var
C:\Cygwin\var\log

Source Cygwin SSHD HowTo

See also StackOverflow question Unable to start cygwin sshd service


Further reading

0

Checking /var/log/sshd.log sshd complained about /var/empty now owned by root (which is called "SYSTEM" on Windows). The solution was to change the owner in an administrative Cygwin shell:

chown SYSTEM /var/empty
1
  • i don't know if you had the same error as the person asking the question.. but i do, and ssh server log file (in my case /var/log/cygsshd.log) , is empty
    – barlop
    Commented Jun 5, 2022 at 21:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .