SSH server installation on Windows

4

3

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.

Mukesh Reddy

Posted 2012-07-03T09:00:34.843

Reputation: 41

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 – 2015-08-25T11:39:05.133

i am asking openssh server installation guidance – None – 2012-07-03T09:16:28.800

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 – 2012-07-04T06:28:26.827

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 – 2012-07-04T11:00:34.893

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 – 2012-07-06T06:59:16.397

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 – 2012-07-07T10:52:30.500

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 – 2012-07-08T00:43:46.847

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 – 2012-07-09T04:33:54.533

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 – 2012-07-09T04:34:21.257

These are my event logs of opensshd and sshd check once – Mukesh Reddy – 2012-07-09T04:35:45.497

Answers

0

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

Posted 2012-07-03T09:00:34.843

Reputation: 13 764

-1

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

user87883

Posted 2012-07-03T09:00:34.843

Reputation: