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.

Using an administrator privileged account I have installed cygwin sshd following instructions here successfully on Windows XP, Vista, but on Windows 7, after installation without errors when I try to start the service ...

net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service could not be started.

The service did not report an error.

More help is available by typing NET HELPMSG 3534.

Has anyone seen this error, got any ideas on what might be wrong?

share

locked by Michael Hampton Jul 6 at 18:42

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

comments disabled on deleted / locked posts

7 Answers 7

up vote 7 down vote accepted

I just had this problem, and solved it, eventually. Firstly, make sure you were having the same issues as me. To do this, check the contents of your /var/log/sshd.log file:

cat /var/log/sshd.log

If the last line reads:

/var/empty must be owned by root and not group or world-writable.

then I can help you. Read on.

All of the following need to run from an elevated cygwin prompt. Right click on the cygwin icon and choose "Run as Administrator..."

First of all you need to change the permissions on /var/empty:

chmod 700 /var/empty

Then you need to change the owner of /var/empty. Now this is the confusing part. The error message in the log file indicates that the directory must be owned by root (SYSTEM on Windows). This is actually incorrect. It must be owned by the account that the windows service is running as. If you followed the openSSH readme, this will probably be *cyg_server*. Assuming it is, you want to run:

chown cyg_server /var/empty

If you get an error stating that *cyg_server* is an unknown user, try running:

mkpasswd -l > /etc/passwd

then try running the chown command again.

Hope that helps!

share
    
Didn't help in my case: James@Greine:/var/log$ ls -ld /var/empty drwx------+ 1 cyg_server root 0 2010-05-11 07:34 /var/empty But I'm still getting the "/var/empty must be owned by root and not group or world-writable." message in the log and sshd isn't starting. –  James Moore Aug 22 '10 at 14:28
    
chown SYSTEM /var/empty solved my problem –  Philippe Blayo Oct 11 '12 at 14:36
add comment

I had the same problem... Including the empty sshd.log. After a lot of very frustrating tests (no hint given on the net would help me) I finally found the problem: in my path there was an older version of one of the cygwin DLLs. This didn't show up when running the command line but caused the service to fail.

share
add comment

I think this is the fact that Cygwin hasn't quite caught up with the changes Microsoft made to Windows 7. I've been trying to get various SSH servers running for some time on Win 7 (since Beta 1) and have got the same message as yourself.

Tried Opensshd, copssh, freesshd to no avail.

share
add comment

I've solved this on my machine.

Try this:

  • right click on the openssh folder on program files and choose properties;
  • on security tab, select advanced;
  • on owner tab (i'm not sure if is owner, but is something related, 'cause I'm on a brazilian windows) click on edit;
  • on this new window, click on other users or groups and type in system and hit ;
  • click on ok then ok again;
  • start the service, eighter by running net start opensshd or by running services.msc and starting it on the list.
share
add comment

You also need to make sure you have something like this in your /etc/passwd:

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

share
add comment

I had the same problem as the original poster, but my sshd.log was always empty. I got it working well enough by running:

/usr/sbin/sshd.exe

from a Cygwin terminal. It won't start automatically, but it was enough that I could get my work done.

share
add comment

Mind Fixed this way

Add this line into /etc/passwd,

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

and this line into /etc/group

/etc/group:sshd:*:27:

Then net start sshd

You will get

The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.
share
add comment

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