cannot access SSH after password reset on linux

Emil Kazimov 1 Reputation point
2021-12-22T19:39:40.547+00:00

Hello,
Cannot access SSH after password reset on linux VM(Azure). SSH port 22 inaccessible.
Please advice.

159760-azure.png

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

2 answers

Sort by: Most helpful
  1. Bhanu Ejjagiri 261 Reputation points Microsoft Employee
    2021-12-22T20:17:18.927+00:00

    Hi @Emil Kazimov
    In general password reset will not block/effect SSH connection or disable port 22.

    However, Please try to login into the VM over Serial Console to troubleshoot the issue.
    Please refer this article if you are new to Azure VM Serial Console # https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-linux

    Once you logged in, Please use the following command to verify whether SSH is running on your VM: "ps -aux | grep ssh"
    If there is any output, SSH is up and running.

    You can use the following command to check which port SSH is running on: "sudo grep Port /etc/ssh/sshd_config"

    Please check the guest firewall status, try to disable it and try to SSH : "syetemctl status firewalld" or "sudo ufw status"
    Try disabling/stoping the firewall: "sudo systemctl start ssh" or "service sshd start" or "service ufw stop"

    P.S: I am hoping that there were no changes applied at Azure infrastructure side, such as NSG port block on port 22 and the Linux distribution that you are using is a Marketplace through provisioned non-customized linux version.

    Please feel free to let me know if you have any further queries.

    0 comments No comments

  2. Bruno Lopes 26 Reputation points
    2022-02-03T18:26:47.29+00:00

    @Emil Kazimov you can access your machine with the Serial Console and then solve the SSH issue. ![171116-snag-199d432.png][1] [1]: /api/attachments/171116-snag-199d432.png?platform=QnA

    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.