Skip to content

Windows could not start the sshd service on Local Computer. #1015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DFazeli opened this issue Jan 13, 2018 · 7 comments
Closed

Windows could not start the sshd service on Local Computer. #1015

DFazeli opened this issue Jan 13, 2018 · 7 comments

Comments

@DFazeli
Copy link

DFazeli commented Jan 13, 2018

I have windows server 2016 ver 1607. downlaod latest ver ssh (0.0.24.0). then i installed.
1 )

PS C:\Program Files\OpenSSH-Win64> .\install-sshd.ps1
[SC] SetServiceObjectSecurity SUCCESS
[SC] ChangeServiceConfig SUCCESS
[SC] ChangeServiceConfig2 SUCCESS
sshd and ssh-agent services successfully installed

2 )

PS C:\Program Files\OpenSSH-Win64> .\ssh-keygen.exe -A
PS C:\Program Files\OpenSSH-Win64> ssh-keygen.exe genrate new host key : ....

3 ) start service sshd

but I have an error

---------------------------
Services
---------------------------
Windows could not start the sshd service on Local Computer.
Error 1067: The process terminated unexpectedly.
---------------------------
OK   
---------------------------

Please explain complete. how can I install sshd on win 2016 server?
I want setup sftp server.
Thanks a lot.

@bagajjal
Copy link
Collaborator

You missed to fix the host key permissions.
Please follow the install instructions here
https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH

@manojampalam
Copy link
Contributor

Reopen if you still see this issue

@dfmuscat
Copy link

dfmuscat commented Sep 24, 2018

This is fine for install-win32 but what about the X64 version. All the blogs/comments are for 32bit. I do not hear anything from the contributors for X64 platform, Not sure if 64bit is being addressed

@bagajjal
Copy link
Collaborator

@dfmuscat - We support all the platforms (X86, X64, ARM-32, ARM-64).

@breakndenter
Copy link

It might not be related but i manage to start the service after exiting Openvpn and Plex and stopping the respective services. I tried to replicate to see witch one after restart , uninstall etc but since that everything was smooth sailing and the pesky error never appeared on my machine again.

@s2zaman
Copy link

s2zaman commented Jun 26, 2019

The 64bit version too is working now.
I suspect it is a permissions issue with 64bit version only.

Thanks @amakhno for pointing it out.

The FixHostFilePermissions.ps1 powershell script residing at C:\Program Files\OpenSSH-Win64\FixHostFilePermissions.ps1 resolved the error The OpenSSH SSH Server service terminated unexpectedly.

The sshd service is now starting successfully.
Can be found in services with the OpenSSH SSH Server as display name.

@MBetters
Copy link

Please note on the installation instructions page that the 64-bit version sometimes requires you to run FixHostFilePermissions.ps1 in an elevated PowerShell before net start sshd works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants