Having trouble with starting OpenSSH Server service on windows VM. Not able to do SSH from Linux Server to Windows server but SSH from Windows to Linux Server is successful, SSH port are open on both server.

Shreyam 0 Reputation points
2025-01-30T06:24:25.1366667+00:00

I have 2 VMs, one having Linux and another Windows. While doing SSH from windows server to Linux server, I am able to connect the Linux VM but when I try to do SSH from Linux to Windows, connection fails. SSH is allowed in Inbound NSG rules of both VMs.

Linux VM NSGUser's image

Windows VM NSGUser's image

OpenSSH server is installed on Windows VM but when I start the Server I receive following errors
User's image I am not able to find any solution for this error online, please help.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,325 questions
{count} votes

3 answers

Sort by: Most helpful
  1. AlexZhu-MSFT 6,501 Reputation points Microsoft Vendor
    2025-01-30T06:51:42.1633333+00:00

    Hi,

    It seems the openSSH service fails to run, please open the event viewer (eventvwr.msc) to check more details. Mostly, some requirements are not met.

    In addition, you can try uninstalling and then install the openSSH server again,

    Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 
    
    # Install the OpenSSH Server 
    Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
    
    

    After that, we can check the service status like below:

    open_ssh

    Regards,

    Alex

    1 person found this answer helpful.
    0 comments No comments

  2. MotoX80 35,416 Reputation points
    2025-01-30T14:33:50.96+00:00

    Start by checking the SSH logs. Look for log files in C:\ProgramData\ssh\logs or in the event viewer under "Applications and Services Logs" look for OpenSSH/Operational. Look for errors.

    Have you modified security permissions on C:\ProgramData\ssh? If you have, you should reset them.

    https://learn.microsoft.com/en-us/answers/questions/2110625/service-is-not-starting

    0 comments No comments

  3. Ativadore Brasil 0 Reputation points
    2025-01-30T14:36:07.9333333+00:00

    On the Windows VM, go to "Settings" > "Apps" > "Optional Features" and check if the OpenSSH Server feature is installed. If not, install it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.