ssh: connect to host port 22

OĞUZHAN YILDIRIM 0 Reputation points
2024-11-25T14:39:28.01+00:00

tried to connect my Linux VM from computer(windows) with same network but it can't be done. It's shown the result: ssh: connect to host port 22: Connection timed out. how can I get this working? Thanks.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,093 questions
Microsoft Intune Linux
Microsoft Intune Linux
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Linux: A family of open-source Unix-like operating systems.
56 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Lijitha B 505 Reputation points Microsoft Vendor
    2024-11-26T06:54:50.78+00:00

    Hi OĞUZHAN YILDIRIM,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    I can suggest you with some troubleshooting steps

    • Check if your Linux VM is running and connected to the network. You can do this by pinging the VM’s IP address from your Windows computer. If the ping fails, it might mean the VM is turned off or not properly connected to the network.
    • Verify that the SSH service is active on the Linux VM. Log into the VM and run sudo systemctl status ssh to check if SSH is running. If it's not, start it by running sudo systemctl start ssh.
    • Check if your Linux VM’s firewall is blocking SSH connections. Temporarily disable the firewall and try connecting again. If the connection works after disabling the firewall, you'll need to configure it to allow SSH traffic.
    • Ensure your router isn’t blocking SSH on port 22. Some routers may block certain ports, so you may need to adjust the settings to allow SSH traffic through port 22.

    Additionally, I would suggest that you go through the documentation, as it might be helpful.
    Can't connect to Azure Linux VM through network
    Connect to a Linux VM

    If you have any further queries, do let us know.

    If the answer is helpful, please click "Accept Answer" and "Upvote 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.