Skip to content

Commit a9e46a2

Browse files
committed
update screenshots
Update bastion-connect-vm-ssh-linux.md Update bastion-connect-vm-ssh-linux.md Update bastion-connect-vm-ssh-linux.md screenshots old shots update update
1 parent 7014bbc commit a9e46a2

23 files changed

+173
-96
lines changed

articles/bastion/bastion-connect-vm-ssh-linux.md

Lines changed: 90 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
title: 'Connect to a Linux VM using SSH'
33
titleSuffix: Azure Bastion
44
description: Learn how to use Azure Bastion to connect to Linux VM using SSH.
5-
services: bastion
65
author: cherylmc
76
ms.service: bastion
87
ms.topic: how-to
9-
ms.date: 10/12/2021
8+
ms.date: 08/18/2022
109
ms.author: cherylmc
1110
ms.custom: ignite-fall-2021
1211
---
@@ -15,12 +14,9 @@ ms.custom: ignite-fall-2021
1514

1615
This article shows you how to securely and seamlessly create an SSH connection to your Linux VMs located in an Azure virtual network directly through the Azure portal. When you use Azure Bastion, your VMs don't require a client, agent, or additional software. You can also connect to a Linux VM using RDP. For information, see [Create an RDP connection to a Linux VM](bastion-connect-vm-rdp-linux.md).
1716

18-
Azure Bastion provides secure connectivity to all of the VMs in the virtual network in which it is provisioned. Using Azure Bastion protects your virtual machines from exposing RDP/SSH ports to the outside world, while still providing secure access using RDP/SSH. For more information, see the [What is Azure Bastion?](bastion-overview.md).
17+
Azure Bastion provides secure connectivity to all of the VMs in the virtual network in which it's provisioned. Using Azure Bastion protects your virtual machines from exposing RDP/SSH ports to the outside world, while still providing secure access using RDP/SSH. For more information, see the [What is Azure Bastion?](bastion-overview.md) overview article.
1918

20-
When connecting to a Linux virtual machine using SSH, you can use both username/password and SSH keys for authentication. You can connect to your VM with SSH keys by using either:
21-
22-
* A private key that you manually enter
23-
* A file that contains the private key information
19+
When connecting to a Linux virtual machine using SSH, you can use both username/password and SSH keys for authentication.
2420

2521
The SSH private key must be in a format that begins with `"-----BEGIN RSA PRIVATE KEY-----"` and ends with `"-----END RSA PRIVATE KEY-----"`.
2622

@@ -41,72 +37,121 @@ In order to make a connection, the following roles are required:
4137
In order to connect to the Linux VM via SSH, you must have the following ports open on your VM:
4238

4339
* Inbound port: SSH (22) ***or***
44-
* Inbound port: Custom value (you will then need to specify this custom port when you connect to the VM via Azure Bastion)
40+
* Inbound port: Custom value (you'll then need to specify this custom port when you connect to the VM via Azure Bastion)
4541

4642
> [!NOTE]
4743
> If you want to specify a custom port value, Azure Bastion must be configured using the Standard SKU. The Basic SKU does not allow you to specify custom ports.
4844
>
4945
50-
## <a name="username"></a>Connect: Using username and password
46+
## Bastion connection page
5147

52-
1. Open the [Azure portal](https://portal.azure.com). Go to the virtual machine that you want to connect to, then click **Connect** and select **Bastion** from the dropdown.
48+
1. In the [Azure portal](https://portal.azure.com), go to the virtual machine that you want to connect to. On the **Overview** page, select **Connect**, then select **Bastion** from the dropdown to open the Bastion connection page. You can also select **Bastion** from the left pane.
5349

5450
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/connect.png" alt-text="Screenshot shows the overview for a virtual machine in Azure portal with Connect selected" lightbox="./media/bastion-connect-vm-ssh-linux/connect.png":::
5551

56-
1. After you select Bastion, click **Use Bastion**. If you didn't provision Bastion for the virtual network, see [Configure Bastion](./quickstart-host-portal.md).
57-
1. On the **Connect using Azure Bastion** page, enter the **Username** and **Password**.
52+
1. On the **Bastion** connection page, click the **Connection Settings** arrow to expand all the available settings. If you are using a Bastion **Standard** SKU, you have more available settings than a Basic SKU.
53+
54+
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/connection-settings.png" alt-text="Screenshot shows connection settings.":::
55+
56+
1. Authenticate and connect using one of the methods in the following sections.
57+
58+
* [Username and password](#username-and-password)
59+
* [Private key from local file](#private-key-from-local-file)
60+
* [Password - Azure Key Vault](#password---azure-key-vault)
61+
* [Private key - Azure Key Vault](#private-key---azure-key-vault)
62+
63+
## Username and password
64+
65+
Use the following steps to authenticate using username and password.
66+
67+
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/password.png" alt-text="Screenshot shows Password authentication.":::
68+
69+
1. To authenticate using a username and password, configure the following settings:
70+
71+
* **Protocol**: Select SSH.
72+
* **Port**: Input the port number. Custom port connections are available for the Standard SKU only.
73+
* **Authentication type**: Select **Password** from the dropdown.
74+
* **Username**: Enter the username.
75+
* **Password**: Enter the **Password**.
76+
77+
1. To work with the VM in a new browser tab, select **Open in new browser tab**.
78+
79+
1. Click **Connect** to connect to the VM.
80+
81+
## Private key from local file
82+
83+
Use the following steps to authenticate using an SSH private key from a local file.
84+
85+
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/private-key-file.png" alt-text="Screenshot shows private key from local file authentication.":::
86+
87+
1. To authenticate using a private key from a local file, configure the following settings:
88+
89+
* **Protocol**: Select SSH.
90+
* **Port**: Input the port number. Custom port connections are available for the Standard SKU only.
91+
* **Authentication type**: Select **SSH Private Key from Local File** from the dropdown.
92+
* **Local File**: Select the local file.
93+
* **SSH Passphrase**: Enter the SSH passphrase if necessary.
94+
95+
1. To work with the VM in a new browser tab, select **Open in new browser tab**.
96+
97+
1. Click **Connect** to connect to the VM.
98+
99+
## Password - Azure Key Vault
100+
101+
Use the following steps to authenticate using a password from Azure Key Vault.
58102

59-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/password.png" alt-text="Screenshot shows Password authentication.":::
60-
1. Select **Connect** to connect to the VM.
103+
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/password-key-vault.png" alt-text="Screenshot shows password from Azure Key Vault authentication.":::
61104

62-
## <a name="privatekey"></a>Connect: Manually enter a private key
105+
1. To authenticate using a password from Azure Key Vault, configure the following settings:
63106

64-
1. Open the [Azure portal](https://portal.azure.com). Go to the virtual machine that you want to connect to, then click **Connect** and select **Bastion** from the dropdown.
107+
* **Protocol**: Select SSH.
108+
* **Port**: Input the port number. Custom port connections are available for the Standard SKU only.
109+
* **Authentication type**: Select **Password from Azure Key Vault** from the dropdown.
110+
* **Username**: Enter the username.
111+
* **Subscription**: Select the subscription.
112+
* **Azure Key Vault**: Select the Key Vault.
113+
* **Azure Key Vault Secret**: Select the Key Vault secret containing the value of your SSH private key.
65114

66-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/connect.png" alt-text="Screenshot of the overview for a virtual machine in Azure portal with Connect selected." lightbox="./media/bastion-connect-vm-ssh-linux/connect.png":::
67-
1. After you select Bastion, click **Use Bastion**. If you didn't provision Bastion for the virtual network, see [Configure Bastion](./quickstart-host-portal.md).
68-
1. On the **Connect using Azure Bastion** page, enter the **Username** and **SSH Private Key**.
115+
* If you didn’t set up an Azure Key Vault resource, see [Create a key vault](../key-vault/secrets/quick-create-powershell.md) and store your SSH private key as the value of a new Key Vault secret.
69116

70-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/ssh-private-key.png" alt-text="Screenshot of SSH Private Key authentication.":::
71-
1. Enter your private key into the text area **SSH Private Key** (or paste it directly).
72-
1. Select **Connect** to connect to the VM.
117+
* Make sure you have **List** and **Get** access to the secrets stored in the Key Vault resource. To assign and modify access policies for your Key Vault resource, see [Assign a Key Vault access policy](../key-vault/general/assign-access-policy-portal.md).
73118

74-
## <a name="ssh"></a>Connect: Using a private key file
119+
> [!NOTE]
120+
> Please store your SSH private key as a secret in Azure Key Vault using the **PowerShell** or **Azure CLI** experience. Storing your private key via the Azure Key Vault portal experience will interfere with the formatting and result in unsuccessful login. If you did store your private key as a secret using the portal experience and no longer have access to the original private key file, see [Update SSH key](../virtual-machines/extensions/vmaccess.md#update-ssh-key) to update access to your target VM with a new SSH key pair.
121+
>
75122
76-
1. Open the [Azure portal](https://portal.azure.com). Go to the virtual machine that you want to connect to, then click **Connect** and select **Bastion** from the dropdown.
123+
1. To work with the VM in a new browser tab, select **Open in new browser tab**.
77124

78-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/connect.png" alt-text="Screenshot depicts the overview for a virtual machine in Azure portal with Connect selected." lightbox="./media/bastion-connect-vm-ssh-linux/connect.png":::
79-
1. After you select Bastion, click **Use Bastion**. If you didn't provision Bastion for the virtual network, see [Configure Bastion](./quickstart-host-portal.md).
80-
1. On the **Connect using Azure Bastion** page, enter the **Username** and **SSH Private Key from Local File**.
125+
1. Click **Connect** to connect to the VM.
81126

82-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/private-key-file.png" alt-text="Screenshot depicts SSH Private Key file.":::
127+
## Private key - Azure Key Vault
83128

84-
1. Browse for the file, then select **Open**.
85-
1. Select **Connect** to connect to the VM. Once you click Connect, SSH to this virtual machine will directly open in the Azure portal. This connection is over HTML5 using port 443 on the Bastion service over the private IP of your virtual machine.
129+
Use the following steps to authenticate using a private key stored in Azure Key Vault.
86130

87-
## <a name="akv"></a>Connect: Using a private key stored in Azure Key Vault
131+
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/ssh-key-vault.png" alt-text="Screenshot shows Private key stored in Azure Key Vault authentication.":::
88132

89-
1. Open the [Azure portal](https://portal.azure.com). Go to the virtual machine that you want to connect to, then click **Connect** and select **Bastion** from the dropdown.
133+
1. To authenticate using a private key stored in Azure Key Vault, configure the following settings:
90134

91-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/connect.png" alt-text="Screenshot showing the overview for a virtual machine in Azure portal with Connect selected" lightbox="./media/bastion-connect-vm-ssh-linux/connect.png":::
92-
1. After you select Bastion, click **Use Bastion**. If you didn't provision Bastion for the virtual network, see [Configure Bastion](./quickstart-host-portal.md).
93-
1. On the **Connect using Azure Bastion** page, enter the **Username** and select **SSH Private Key from Azure Key Vault**.
135+
* **Protocol**: Select SSH.
136+
* **Port**: Input the port number. Custom port connections are available for the Standard SKU only.
137+
* **Authentication type**: Select **SSH Private Key from Azure Key Vault** from the dropdown.
138+
* **Username**: Enter the username.
139+
* **Subscription**: Select the subscription.
140+
* **Azure Key Vault**: Select the Key Vault.
94141

95-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/ssh-key-vault.png" alt-text="Screenshot showing SSH Private Key from Azure Key Vault.":::
96-
1. Select the **Azure Key Vault** dropdown and select the resource in which you stored your SSH private key.
142+
* If you didn’t set up an Azure Key Vault resource, see [Create a key vault](../key-vault/secrets/quick-create-powershell.md) and store your SSH private key as the value of a new Key Vault secret.
97143

98-
* If you didn’t set up an Azure Key Vault resource, see [Create a key vault](../key-vault/secrets/quick-create-powershell.md) and store your SSH private key as the value of a new Key Vault secret.
144+
* Make sure you have **List** and **Get** access to the secrets stored in the Key Vault resource. To assign and modify access policies for your Key Vault resource, see [Assign a Key Vault access policy](../key-vault/general/assign-access-policy-portal.md).
99145

100-
* Make sure you have **List** and **Get** access to the secrets stored in the Key Vault resource. To assign and modify access policies for your Key Vault resource, see [Assign a Key Vault access policy](../key-vault/general/assign-access-policy-portal.md).
146+
> [!NOTE]
147+
> Please store your SSH private key as a secret in Azure Key Vault using the **PowerShell** or **Azure CLI** experience. Storing your private key via the Azure Key Vault portal experience will interfere with the formatting and result in unsuccessful login. If you did store your private key as a secret using the portal experience and no longer have access to the original private key file, see [Update SSH key](../virtual-machines/extensions/vmaccess.md#update-ssh-key) to update access to your target VM with a new SSH key pair.
148+
>
101149
102-
> [!NOTE]
103-
> Please store your SSH private key as a secret in Azure Key Vault using the **PowerShell** or **Azure CLI** experience. Storing your private key via the Azure Key Vault portal experience will interfere with the formatting and result in unsuccessful login. If you did store your private key as a secret using the portal experience and no longer have access to the original private key file, see [Update SSH key](../virtual-machines/extensions/vmaccess.md#update-ssh-key) to update access to your target VM with a new SSH key pair.
104-
>
150+
* **Azure Key Vault Secret**: Select the Key Vault secret containing the value of your SSH private key.
105151

106-
:::image type="content" source="./media/bastion-connect-vm-ssh-linux/private-key-stored.png" alt-text="Screenshot showing Azure Key Vault." lightbox="./media/bastion-connect-vm-ssh-linux/private-key-stored.png":::
152+
1. To work with the VM in a new browser tab, select **Open in new browser tab**.
107153

108-
1. Select the **Azure Key Vault Secret** dropdown and select the Key Vault secret containing the value of your SSH private key.
109-
1. Select **Connect** to connect to the VM. Once you click **Connect**, SSH to this virtual machine will directly open in the Azure portal. This connection is over HTML5 using port 443 on the Bastion service over the private IP of your virtual machine.
154+
1. Click **Connect** to connect to the VM.
110155

111156
## Next steps
112157

0 commit comments

Comments
 (0)