Azure - SSH troubleshooting

Card Puncher Data Processing

About

When you can't connect to your machine via SSH.

Steps

The documentation

  • Go to the Azure Portal
  • Select your machine
  • Select “Diagnose and solve problems”
  • Wait a little bit
  • Select “I can't connect to my Linux VM”

Azure Diagnose Connection Linux Vm

The VM is running ?

Azure Vm Status

Verify if your VM is running by viewing your VM's console screenshot or logs.

Boot diagnostic

  • Enable the Boot Diagnostics. (Vm> Support + Troubleshooting sub-header > Boot Diagnostic > Diagnostic Settings)

To store boot diagnostics for a VM, you need a storage account. These boot diagnostics can help you troubleshoot problems and monitor the status of your VM. The storage account you create is only to store the boot diagnostics data.

Azure Bootdiagnostic Enable

  • Restart the machine
  • Check the log. Review errors in the logs such as:

Azure Bootdiagnostic Serial Log

Review effective security group rules

Azure Networking Inbound Rule Ssh

Reset Ssh Configuration

  • Azure portal > Support + Troubleshooting section > Reset password
  • Or with the Azure Cli
    • Create the file reset_sshd.json
{
    "reset_ssh":"True"
}
  • Execute the following command
az.cmd vm extension set \
  --resource-group resourceGroupName \
  --vm-name vmName \
  --name VMAccessForLinux \
  --publisher Microsoft.OSTCExtensions \
  --version 1.4 \
  --protected-settings reset_sshd.json

Redeploy

Address any Azure host issues by redeploying, which will migrate the VM to a new Azure host

Azure Vm Redeploy

Documentation / Reference





Discover More
Card Puncher Data Processing
Azure - Networking

Networking in Azure A network security group (NSG) is a collection of firewall rules that can be applied to a machine. ...



Share this page:
Follow us:
Task Runner