How to Connect to Azure VM with Remote Desktop and SSH

Author

Reads 866

Computer server in data center room
Credit: pexels.com, Computer server in data center room

Connecting to your Azure VM with Remote Desktop is a straightforward process that requires a few basic steps. You can use Remote Desktop Protocol (RDP) to access your VM from anywhere.

First, make sure you have the IP address of your VM. You can find this in the Azure portal under "Overview" for your VM. Then, open Remote Desktop Connection on your local machine and enter the IP address, followed by the username and password for your VM.

To use SSH, you'll need to enable it on your VM. This can be done in the Azure portal by navigating to "Networking" and selecting "Add SSH Public Key". You'll also need to generate a public-private key pair on your local machine using a tool like PuTTYgen.

Network Configuration

To connect to an Azure VM, you need to configure your network settings. This involves setting up a virtual network, subnets, and network security groups.

Credit: youtube.com, Azure Virtual Machine Connectivity with Virtual Private Network client.

A virtual network is a virtualized version of a physical network, allowing you to create a network in the cloud. You can create a virtual network in the Azure portal.

To connect to your Azure VM, you'll need to assign a public IP address to it. This is done by creating a public IP address resource in the Azure portal.

Remote Access

To connect to an Azure VM, you'll want to establish remote access. This can be achieved by creating a jumpbox, a dedicated machine that allows you to connect to other virtual machines without exposing them to the internet.

A jumpbox is a simple solution that involves creating a virtual machine in the same virtual network as your VMs, associating a public IP address with it, and opening RDP/SSH ports using network security group rules. This way, you can connect to the jumpbox and then access your VMs through it.

Credit: youtube.com, How to quickly connect to Windows VMs using RDP | Azure Tips and Tricks

Alternatively, you can use Azure Bastion, a managed PaaS service that provides RDP/SSH capabilities over TLS. This service is provisioned inside your virtual network and doesn't require public IP addresses for your VMs. You can connect to Azure Bastion using the Azure portal, and it will handle the connection to your VMs.

To connect from the Azure portal, follow these steps: Go to the Azure portal, search for and select Virtual machines, select the virtual machine from the list, select Connect from the left menu, and select the option that fits your preferred way of connecting.

Remote Desktop Protocol

To connect to a VM using Remote Desktop Protocol, you can follow these steps.

First, go to the Azure portal to connect to a VM.

You can search for and select Virtual machines from the list.

Select the virtual machine from the list, and then select Connect from the left menu.

The portal will help walk you through the prerequisites for connecting, and you can choose the option that fits with your preferred way of connecting.

Using Azure Bastion

Credit: youtube.com, RDP to Azure Virtual machines using Azure Bastion

Azure Bastion is a managed service that offers a secure and scalable way to access virtual machines remotely. It's a PaaS service that's provisioned inside your virtual network, into a subnet named AzureBastionSubnet.

One of the key benefits of Azure Bastion is that it doesn't expose RDP/SSH ports to the internet, so your virtual machines don't need public IP addresses. Instead, Bastion connects to VMs using private IP addresses.

Azure Bastion provides RDP/SSH capabilities in Azure Portal over TLS, but not all capabilities might be supported since technically only Bastion to VM connection is RDP/SSH.

Azure Bastion has built-in audit logs, improved security, and potential for additional features like session video recording. It's also a Virtual Machine Scale Set, which allows it to scale when the number of sessions increases.

To use Azure Bastion, you can apply a Network Security Group to the AzureBastionSubnet if needed, just make sure your NSG allows necessary traffic.

Credit: youtube.com, How to remote login with Azure Bastion

Azure Bastion allows virtual network peering, which enables you to have one Bastion connect to VMs in different virtual networks.

Here are the key features of Azure Bastion:

  • Managed PaaS service
  • Provisioned inside your virtual network, into subnet named AzureBastionSubnet
  • RDP/SSH capabilities in Azure Portal over TLS
  • No public IP addresses needed for virtual machines
  • Built-in audit logs and improved security
  • Virtual Machine Scale Set for scalability
  • Network Security Group can be applied
  • Virtual network peering enabled

SSH Key Formats

SSH Key Formats are a crucial aspect of secure remote access. They allow you to authenticate your identity without sharing sensitive information like passwords.

The supported SSH key formats are limited, but they're reliable and widely used. RSA keys with a minimum length of 2048 bits are a popular choice.

ED25519 keys, on the other hand, offer a fixed length of 256 bits. They're a great option if you want a more straightforward key format.

Other key formats like Elliptic-curve Diffie–Hellman (ECDH) and Elliptic Curve Digital Signature Algorithm (ECDSA) are not currently supported.

Azure Portal

The Azure Portal is a powerful tool for managing your Azure Virtual Machines. From here, you can connect to your VM and start working.

To access the Azure Portal, simply go to the Azure portal to connect to a VM. Search for and select Virtual machines.

Credit: youtube.com, 2. How To Connect To Azure Virtual Machine |Azure VM | Step-by-Step Guide

Once you've selected your VM, you can connect to it by following the steps outlined in the Connect to virtual machine section. This involves creating a remote desktop connection to the virtual machine, which can be done by selecting the Connect > RDP option on the overview page for your virtual machine.

Here's a step-by-step guide to connecting to your VM using the Azure Portal:

  1. Go to the Azure portal to connect to a VM. Search for and select Virtual machines.
  2. Select the virtual machine from the list.
  3. Select Connect from the left menu.
  4. Select the option that fits with your preferred way of connecting.

Azure Portal View

The Azure Portal View is a great place to get a birds-eye view of your Azure resources. You can see exactly how your load balancers are set up, including rules for forwarding traffic to specific VMSS instances.

For example, if you have a load balancer set up for a VMSS with two instances, you'll see a rule that forwards all requests over TCP to the second instance at port 3389 (or 22 for SSH). This is a key feature of the Azure Portal View.

Credit: youtube.com, Getting started in the Azure Portal

The Azure Portal View also shows you the IP address and port that incoming requests should be sent to. In the case of the example load balancer, this is IP 20.69.134.228 at port 50002.

To connect to a VM from the Azure Portal, you can follow these steps:

  1. Go to the Azure portal to connect to a VM. Search for and select Virtual machines.
  2. Select the virtual machine from the list.
  3. Select Connect from the left menu.
  4. Select the option that fits with your preferred way of connecting. The portal helps walk you through the prerequisites for connecting.

Create Virtual Machine

To create a virtual machine in the Azure Portal, start by entering "virtual machines" in the search bar.

You'll then need to select Virtual machines under the Services tab.

Next, click on Create and then Azure virtual machine to open the Create a virtual machine page.

Under Instance details, enter a name for your virtual machine, such as "myVM", and choose the image you want to use, which in this case is Windows Server 2022 Datacenter: Azure Edition - x64 Gen 2.

Note that some users may see an option to create VMs in multiple zones, but that's a topic for another time.

Credit: youtube.com, How to Create a Virtual Machine in Azure Portal Free - Step by Step

Leave the other defaults for now and move on to the Administrator account section.

Here, you'll need to provide a username, such as "azureuser", and a password that meets the complexity requirements, which means it must be at least 12 characters long.

Under Inbound port rules, choose Allow selected ports and select RDP (3389) and HTTP (80) from the drop-down menu.

Leave the remaining defaults and click the Review + create button at the bottom of the page.

After validation runs, click the Create button to begin the deployment process.

Once deployment is complete, select Go to resource to access your new virtual machine.

Thomas Goodwin

Lead Writer

Thomas Goodwin is a seasoned writer with a passion for exploring the intersection of technology and business. With a keen eye for detail and a knack for simplifying complex concepts, he has established himself as a trusted voice in the tech industry. Thomas's writing portfolio spans a range of topics, including Azure Virtual Desktop and Cloud Computing Costs.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.