Azure - SSH troubleshooting

> Azure

1 - About

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

2 - Steps

2.1 - 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”

Advertising

2.2 - The VM is running ?

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

2.3 - 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.

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

2.4 - Review effective security group rules

2.5 - Reset Ssh Configuration

  • Azure portal > Support + Troubleshooting section > Reset password
  • Or with the Azure Cli
    • Create the file reset_sshd.json
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
Advertising

2.6 - Redeploy

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

3 - Documentation / Reference

azure/ssh_diagnose.txt · Last modified: 2018/09/16 12:42 by gerardnico