In the previous blog, we saw how to RDP to a Windows VM using Bastion. In this post, we will look at how to SSH to a Linux VM using the Bastion service.
To connect to the VM via Bastion, first, navigate to the Linux VM in Azure. Click on the Connect button. In the pop-out menu, click on the Bastion option.
Next, click on the Use Bastion button on the next screen.
In the next screen to "Connect using Azure Bastion" make note of the following:
- At the top you will see the Bastion host being used for the connection. This is for your information only. You do not need to take any action here. You may need this if you run into any issues and have to troubleshoot.
- I recommend leaving the check box for "Open in new window" checked. This ensures that the connection opens in a new tab or window and uses the maximum area. If you uncheck this then the connection will open in a new blade to the right and the view will be limited.
- Next provide the Username that will be used to connect via SSH to the Linux VM
- Authentication type is important. Select the one that you want to leverage. The next entry will update as per the selection here.
- Provide the additional information for the selection you made in the previous point.
- The advanced settings are optional and can be skipped. This does not relate to all authentication types.
- Finally click on the Connect button to connect to the VM
The options for authentication types are as follows:
- Password - This is to use the normal username and password-based authentication
- SSH Private Key - This option is used when you want to provide the key phrase manually
- SSH Private Key from Local File - This is to upload the private key file from the local computer. You can optionally provide a passphrase for this.
- SSH Private Key from Azure Key Vault - This is to use a private key file that you have previously uploaded to the Azure Key Vault.
Once you click on the Connect button, the SSH session to the VM opens up in a new tab.
Note: Almost all the Caveats from the previous blog for RDP to Windows VM also apply to the SSH to Linux VMs.