Guides

How to SSH into an Azure Virtual Machine

This is a short guide on connecting to your Linux virtual machine made in Microsoft Azure. In this example, I connected using the PowerShell terminal in VSCode on a Windows host.

  1. Open a PowerShell terminal.
  2. Download the PEM file from Azure after creating a new virtual machine.
  3. Copy the IP address of the server.
  4. Use the following template to structure your SSH command.
  5. When you reach the server for the first time, you will be prompted to continue with the connection.

Structure

ssh -i 'path\to\directory\ssh_key.pem' username@ip_address

Example

PS C:\Users\Alex> ssh -i ‘C:\Users\Alex\SSH\ssh_key.pem’ kansasdynamics@192.168.5.6
The authenticity of host ‘192.168.5.6 (192.168.5.6)’ can’t be established.
ECDSA key fingerprint is SHA256:1jk23iojf9123jk12309vm120913nmvk.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
>Warning: Permanently added ‘192.168.5.6’ (ECDSA) to the list of known hosts.
[kansasdynamics@DC01 ~]$

Related Articles