>_ SSHDock
FeaturesHow it worksBlogGuidesAbout
Launch Terminal

How to SSH into Microsoft Azure Virtual Machine

Microsoft Azure Compute Virtual Machine. Learn how to securely connect to your server from any browser without installing native terminal apps like PuTTY or Termius.

Launch SSHDock

Connection Quick Reference

  • Default Username:azureuser
  • Authentication:Password or SSH Key

On this page

  • Network Security Groups (NSGs) in Azure
  • Locating Your Public IP Address
  • Authentication on Azure Linux VMs
  • Connecting with SSHDock
  • Troubleshooting Common Azure Issues

Network Security Groups (NSGs) in Azure

Like AWS, Microsoft Azure defaults to a secure-by-design posture. When you deploy a Linux Virtual Machine, the network interface is associated with a Network Security Group (NSG) which dictates exactly what traffic is allowed in and out of the server.

If you cannot connect to your VM at all (resulting in a Connection timed out error), the most likely culprit is that your NSG is blocking port 22.

To verify your configuration:

  1. Navigate to the Azure Portal and find your Virtual Machine.
  2. In the left-hand menu under Settings, click on Networking.
  3. Look at the Inbound port rules. You should see a rule specifically allowing SSH (Port 22) traffic from your source IP (or Any if you left it open).
  4. If it's missing, click Add inbound port rule, set the Destination port ranges to 22, the Protocol to TCP, and the Action to Allow.

Locating Your Public IP Address

To route your SSH connection over the internet, you need the VM's public IP address.

  1. In the Azure Portal, go to your Virtual Machine's Overview page.
  2. Look on the right side of the summary panel for Public IP address.
  3. Copy this address. Note that if you are using a dynamic IP allocation, this IP address will change if the VM is deallocated (stopped). For persistent servers, you should configure a Static IP address.

Authentication on Azure Linux VMs

During the VM creation process, Azure gives you a choice between two authentication types: SSH public key (recommended) or Password. Azure also asks you to define an administrator username (the default is often azureuser, but you could have chosen anything).

Unlike AWS, Azure allows password authentication out of the box if you explicitly select it during deployment. However, SSH keys remain the vastly superior option for security.

If you selected SSH public key, Azure either allowed you to generate a new key pair (downloading the .pem private key to your machine) or use an existing public key.

Connecting with SSHDock

SSHDock abstracts away the complexities of dealing with Windows native SSH clients, WSL, or PuTTY when connecting to Azure VMs.

  1. Launch SSHDock and click to create a new connection.
  2. Host: Paste the Public IP address of your Azure VM.
  3. Port: Leave as 22.
  4. Username: Enter the administrator username you defined during setup (e.g., azureuser). Do not use root, as Azure prevents direct root logins.
  5. Authentication:
    • If you used a password: Select Password authentication and enter it.
    • If you used an SSH key: Select Private Key authentication. Open the .pem file you downloaded from Azure in a text editor, copy the entire string, and paste it into SSHDock.
  6. Click Connect.

Accept the host key fingerprint on your first connection to establish the encrypted tunnel.

Troubleshooting Common Azure Issues

Permission Denied (publickey)

If SSHDock rejects your private key, ensure you are logging in with the exact administrator username you defined during creation. If you try to log in as root or ubuntu when your username is azureuser, the connection will fail.

If you lost your private key, you can reset the SSH configuration directly from the Azure Portal. Go to your VM, scroll down the left menu to Help > Reset password, select "Reset SSH public key", and provide a new public key.

Connection Timed Out

Double-check the Network Security Group (NSG) attached to your VM's network interface. If the NSG allows port 22 but you still time out, check if the VM is associated with a virtual network (VNet) that routes traffic through an Azure Firewall or a Network Virtual Appliance (NVA) that might be dropping the packets.

Explore Other Integrations

AWS EC2DigitalOcean DropletGoogle Cloud Compute EngineLinode Compute InstanceVultr Cloud Compute
SSHDOCK

Full terminal in your browser. Local credential storage, jump host tunneling, live CPU/memory/disk metrics, and a mobile soft-key bar. Free to use. Built by developers, for developers.

© 2026 SSHDock

GitHub (@ayanhackspro)
App
Launch TerminalFeaturesHow it worksBlog & TutorialsChangelogGuides
Cloud Guides
AWS EC2DigitalOcean DropletGoogle Cloud Compute EngineMicrosoft Azure Virtual MachineLinode Compute InstanceVultr Cloud Compute
Legal & Contact
Privacy PolicyTerms of ServiceDisclaimerContact UsAbout Creator
Modern, minimal browser SSH client
TerminalSitemap