Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I installed cygwin/sshd without good results. I removed the c:\cygwin directory to reinstall. I removed the sshd Administrator user by hand.

I reinstalled the cygwin again, then run the 'ssh-host-config -y', strangely, it doesn't ask anything about making a new user. And the procedure is really short.

$ ssh-host-config -y
* Query: Overwrite existing /etc/ssh_config file? (yes/no) yes
* Info: Creating default /etc/ssh_config file
* Query: Overwrite existing /etc/sshd_config file? (yes/no) yes
* Info: Creating default /etc/sshd_config file
* Info: Privilege separation is set to yes by default since OpenSSH 3.3.
 Info: However, this requires a non-privileged account called 'sshd'.
 Info: For more info on privilege separation read /usr/share/doc/openssh
 Query: Should privilege separation be used? (yes/no) yes
** Info: Updating /etc/sshd_config file

* Info: Host configuration finished. Have fun!

When I ran 'cygrunsrv -S shhd', I get an error. "Win 32 error 1069: The service did not start due to logon failure". It's reasonable message, as I deleted the sshd as a user, and the reinstall procedure did nothing for that again.

I see I got something wrong with the uninstallation.

Q: How can I uninstall the sshd related thing perfectly so that I can reinstall it again?

share|improve this question

2 Answers 2

If sshd had been previously installed on the system, the following cleanup should be performed before invoking ssh-host-config:

# Remove sshd service
cygrunsrv --stop sshd
cygrunsrv --remove sshd
# Delete any sshd or related users (such as cyg_server) from /etc/passwd
#   (use your favorite editor)
# Delete any sshd or relaged users (such as cyg_server) from the system
net user sshd /delete
net user cyg_server /delete
share|improve this answer
Note that, as when sshd was installed, the cygwin shell must be run as Administrator. – f.ardelian Mar 8 at 2:57
There was no file /etc/passwd for me. Other than that, this worked! – John Sep 22 at 4:20
up vote 5 down vote accepted

I had to do three steps to make it reinstalled.

  • delete LOCAL_MACHINE\SYSTEM\ControlSet001\services\sshd
  • run 'sc delete sshd'
  • reboot

The problem is that I can't login the cygwin from the Mac, which is the exact reason I tried to reinstall the cygwin.

I made another thread about this problem. ->

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.