Not able to access the VM using new SSH key

MyTickets 1 Reputation point
2021-08-23T06:39:05.43+00:00

I have added new SHH key to the resource group and I tried to access my VM using new SSH key but couldn't access the VM

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

3 answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,011 Reputation points MVP
    2021-08-23T07:07:16.023+00:00

    Hi @MyTickets

    Please follow quick troubleshooting steps on the below link.

    Troubleshoot SSH connections to an Azure Linux VM that fails, errors out, or is refused
    https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    0 comments No comments

  2. Sumarigo-MSFT 47,526 Reputation points Microsoft Employee
    2021-08-23T11:21:10.53+00:00

    @MyTickets Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    Are you able to login into the Serial console? Can you share the screenshot of the error message?

    This article provides a solution to an issue in which SSH fails because the /var/empty/sshd file is not owned by the root directory and is not group or world-writable.
    Can't connect a Linux VM using SSH connection

    This article helps you find and correct the problems that occur due to Secure Shell (SSH) errors, SSH connection failures, or SSH is refused when you try to connect to a Linux virtual machine (VM). You can use the Azure portal, Azure CLI, or VM Access Extension for Linux to troubleshoot and resolve connection problems. These articles explain how to determine, diagnose, and fix issues that you might encounter when you use Azure Virtual Machines. In the navigation pane on the left, browse through the article list or use the search box to find issues and solutions.

    Create and use an SSH public-private key pair for Linux VMs in Azure

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  3. sam john 0 Reputation points
    2024-04-02T19:50:56.7433333+00:00

    review the ssh server log file to check the error or warning related information which can provide the root cause of issue.
    If you issue is not resolve try to use different SSH client.

    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.