Setting the file. One moment.
Chapter 15 · Azure Diagnostics
Subchapter 15.33
troubleshooting/compute/references/ssh-connectivity.mdMarkdown2 KBView on GitHub
| Symptom | Action | Docs |
|---|---|---|
| connection refused on 22 | Check sshd running/listening and port config | SSH overview (opens in a new tab) |
| connection timed out | Check power state, public IP, NSG, routes | SSH overview (opens in a new tab) |
| permission denied publickey/password | Verify user, key, password auth; reset key/password | SSH detail (opens in a new tab) |
| host key verification failed | Remove stale known_hosts entry | SSH detail (opens in a new tab) |
| server closed connection | Check disk, PAM, sshd config | SSH detail (opens in a new tab) |
| hangs with no response | Check firewall, routes, NIC | SSH overview (opens in a new tab) |
| Debian-specific failure | Check Debian networking/sshd doc | Debian (opens in a new tab) |
| SELinux blocks sshd | Fix SELinux policy or temporarily permissive | SELinux (opens in a new tab) |
| Entra ID SSH denied | Assign VM Admin/User Login role | SSH overview (opens in a new tab) |
| VM not booting/UEFI failure | Use boot diagnostics and repair VM | UEFI (opens in a new tab) |
Commands use VM agent/extensions. Run Pre-Flight Safety Checks first.
az vm user reset-ssh --name <vm> -g <rg>
az vm user update --name <vm> -g <rg> -u <user> --ssh-key-value "<ssh-public-key>"
az vm user update --name <vm> -g <rg> -u <user> -p '<new-password>'
az vm run-command invoke --name <vm> -g <rg> --command-id RunShellScript \
--scripts "systemctl status sshd; getenforce"
az vm run-command invoke --name <vm> -g <rg> --command-id RunShellScript \
--scripts "setenforce 0"