6

I'm working on a SSH project. For that I setup everything on client side.

But I'm facing a problem on my SSH server. I tried some SSH servers like OpenSSH. I installed the OpenSSH server on my Windows PC according to these instructions.

It's working fine only when I run the server in debug mode using the command sshd -ddd.
Or else it's not taking any command from my SSH clients.

I need some suggestions on how to install and setup the SSH server on Windows.

Martin Prikryl
  • 21,071
  • 9
  • 77
  • 157
Mukesh Reddy
  • 61
  • 1
  • 3
  • i am asking openssh server installation guidance –  Jul 03 '12 at 09:16
  • If you check your installed services (e.g. by running `services.msc`), does the OpenSSH service appear in the list? Is it configured for startup type Automatic? – Lars Rohrbach Jul 04 '12 at 06:28
  • yes it's running in services(with automatic startup)but it is responding only when i run it in debug mode using sshd -ddd command – Mukesh Reddy Jul 04 '12 at 11:00
  • and is the service configured to Log On As "Local System"? I can confirm that the setup works on my Win7 machine. Does restarting the service generate any errors? (check your System and Application event logs) – Lars Rohrbach Jul 06 '12 at 06:59
  • service is running, but it's listening the commands from the client, it's listening only when i run it in debug mode using this command sshd -d -d -d – Mukesh Reddy Jul 07 '12 at 10:52
  • Make sure you cancel your `sshd -d -d -d`, and then restart the OpenSSH service. Then check your Windows event logs if it still isn't listening, and report whether any error messages are found there. – Lars Rohrbach Jul 08 '12 at 00:43
  • The description for Event ID ( 0 ) in Source ( OpenSSHd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: OpenSSHd : PID 5008 : `OpenSSHd' service started. – Mukesh Reddy Jul 09 '12 at 04:33
  • The description for Event ID ( 0 ) in Source ( sshd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: sshd : PID 5024 : Server listening on 0.0.0.0 port 22.. – Mukesh Reddy Jul 09 '12 at 04:34
  • These are my event logs of opensshd and sshd check once – Mukesh Reddy Jul 09 '12 at 04:35
  • Have a look at John T's answer here, he's provided really good screenshots to accompany it: http://superuser.com/questions/64058/windows-ssh-servers?rq=1 – Jay Aug 25 '15 at 11:39

2 Answers2

1

Microsoft recently released its own build of OpenSSH for Windows.

See my guide for setting up SSH/SFTP server on Windows using this Microsoft build of OpenSSH.

It does not have a dependency on Cygwin or anything else.

Martin Prikryl
  • 21,071
  • 9
  • 77
  • 157
0

I have used the following instructions which worked successfully on Windows Server 2008 R2 which shares the same codebase as Windows 7:

  1. Logon to the Windows machine as a local administrator
  2. Download Cygwin installer
  3. Run setup program
  4. From package selection expand Net category and select OpenSSH
  5. Finish the installation
  6. Run the Cygwin terminal as Administrator (elevated command prompt)
  7. Run the ssh-host-config program
  8. Answer yes to Should privilege separation be used?
  9. Answer yes to Should this script create a local user ‘sshd’ on this machine?
  10. Answer yes to Do you want to install sshd as a service?
  11. Answer no to Should this script create a new local account ‘ssh_server’ which has the required privileges?
  12. When prompted for a username and password for the service, enter an existing local Windows account that has administrator privileges
  13. Answer ntsec tty for Which value should the environment variable CYGWIN have when sshd starts?
  14. Finish the configuration
  15. Start the service with net start sshd