21

I try to start opensshd app by following command line: net start opensshd but i encounter below message after press enter in CMD:

 The OpenSSH Server service is starting.

The OpenSSH Server service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.

i install openssh. please Help Me!

6 Answers6

37

I got the similar problem that i cannot startup the "OpenSSH SSH Serve" service after following the instructions in https://hostadvice.com/how-to/how-to-install-an-openssh-server-client-on-a-windows-2016-server/

I later on found out that this is the security problem in the C:\ProgramData\ssh\ssh_host*key files. All the key files in this folder should ONLY be owned by following 2 system users:

  1. BUILTIN\Administrators
  2. NT AUTHORITY\SYSTEM

In the Powershell under the C:\ProgramData\ssh folder, issue following command can list out the owners of the file ssh_host_dsa_key:

 PS C:\ProgramData\ssh> icacls .\ssh_host_dsa_key
 .\ssh_host_dsa_key BUILTIN\Administrators:(F)
                    NT AUTHORITY\SYSTEM:(F)
                    xxdomain\otheruser:(M)

 Successfully processed 1 files; Failed processing 0 files

Obviously we need to remove the user "xxdomain\otheruser" from the owner list

Resolution

Updated on Nov 25, 2019: Found out that the OpenSSH-Win64.zip file already contained a powershell script: FixHostFilePermissions.ps1

What you need to do is to run following inside the powershell:

cd 'C:\Program Files\OpenSSH-Win64'
.\FixHostFilePermissions.ps1

And press 'Enter' for each question to update the permission.

Raymond Chiu
  • 934
  • 9
  • 15
7

just write this command in PowerShell

cd 'C:\Program Files\OpenSSH-Win64'
.\FixHostFilePermissions.ps1

then press enter .

javidasd
  • 1,126
  • 13
  • 18
1

I got this error, and it turned out in my case to be an error I'd made editing sshd_config, so be sure to check this. Spent ages trying to diagnose this.

Hope that saves someone some pain.

garryp
  • 5,508
  • 1
  • 29
  • 41
0

I got the same error by installing OpenSSH on Windows 7...

Open "services.msc" and try to start the service from there.

If it still doesn't work then you can try to follow the steps in this tutorial: http://www.techpaste.com/2015/06/windows-ssh-server-setup-and-configuration/

One important thing: Try to download an older version of OpenSSH
Download Link: http://www.mls-software.com/opensshd.html#botpage
(I recommend you the version "setupssh-7.3p1-2")

Hope it works
Cheers

krusty
  • 103
  • 1
  • 1
  • 8
0

For me the solution was to download and install an MSI from this github repo

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32776669) – user16217248 Sep 28 '22 at 21:04
  • @user16217248 It's essentially a download link, there is nothing to add other than why this works. – Monday Fatigue May 04 '23 at 19:16
0
  1. Uninstall old versions of OpenSSH Client & Server from Optional Features.
  2. Remove %ProgramData%\ssh directory and its contents.
  3. Install latest beta version of OpenSSH as explained here: https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
    • Using winget is the easiest way.
    • Run winget uninstall "openssh beta" to remove older version
    • winget install "openssh beta" to install latest version.
  4. In an administrative command prompt, Navigate to %ProgramFiles%\OpenSSH and run both FixHostFilePermissions.ps1 and FixUserFilePermissions.ps1. Answer all to Y(Yes) or A(All).
  5. Try to start the OpenSSH service.
Monday Fatigue
  • 223
  • 1
  • 3
  • 19