Skip to content

Commit 57e75c0

Browse files
authored
Merge pull request #8418 from pagienge/patch-8
AB#4447:Wording clarification
2 parents fb21cca + 33b2b02 commit 57e75c0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

support/azure/virtual-machines/linux/linux-vm-sshconnectionissue-perms.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: SSH connection to Azure Linux VM fails due to permission and ownership issues
33
description: Resolves an issue in which the SSH service fails because the /var/empty/sshd, /var/lib/empty, or /var/run/sshd directory doesn't exist, or it isn't owned by the root user, or it's group-writable or world-writable.
4-
ms.date: 04/15/2024
5-
author: saimsh-msft
6-
ms.reviewer: divargas, adelgadohell
4+
ms.date: 03/13/2025
5+
author: pagienge
6+
ms.reviewer: divargas, adelgadohell, saimsh
77
ms.service: azure-virtual-machines
88
ms.custom: sap:Cannot connect to my VM, linux-related-content
99
ms.collection: linux
@@ -13,15 +13,13 @@ ms.collection: linux
1313

1414
**Applies to:** :heavy_check_mark: Linux VMs
1515

16-
[!INCLUDE [CentOS End Of Life](../../../includes/centos-end-of-life-note.md)]
17-
1816
This article provides solutions to an issue in which connecting to a Linux virtual machine (VM) via Secure Shell (SSH) fails because the _/var/empty/sshd_ directory in RHEL, the _/var/lib/empty_ directory in SUSE, or the _/var/run/sshd_ directory in Ubuntu, doesn't exist, or it isn't owned by the root user, or it's group-writable or world-writable.
1917

2018
## Symptoms
2119

2220
When you connect to a Linux virtual machine (VM) via SSH, the connection fails. You may receive the following error message about the affected directory, depending on your Linux distribution.
2321

24-
### [RHEL/CentOS](#tab/rhelsymp)
22+
### [RHEL](#tab/rhelsymp)
2523

2624
```bash
2725
sudo tail /var/log/messages
@@ -75,7 +73,7 @@ Here are two methods to repair the VM offline:
7573
2. Sign in to the VM by using a local administrative account and its corresponding credential or password.
7674
3. Run the following commands to resolve the permission and ownership issue:
7775

78-
### [RHEL/CentOS](#tab/rhelts1)
76+
### [RHEL](#tab/rhelts1)
7977

8078
```bash
8179
sudo mkdir -p /var/empty/sshd
@@ -111,7 +109,7 @@ In the Azure portal, open the **Properties** window of the VM to check the agent
111109
1. Go to the Azure portal, locate your VM settings, and then select **Run Command** under **Operations**.
112110
2. Execute the following shell script by selecting **RunShellScript** > **Run**:
113111

114-
### [RHEL/CentOS](#tab/rhelts2)
112+
### [RHEL](#tab/rhelts2)
115113

116114
```bash
117115
#!/bin/bash
@@ -155,12 +153,12 @@ If you can connect to the VM via SSH, and you want to analyze the details of the
155153
156154
Here are two methods to repair the VM offline:
157155

158-
- [Use Azure Linux Auto Repair (ALAR).](#offlinetroubleshooting-repairvm)
156+
- [Use az vm repair](#offlinetroubleshooting-repairvm)
159157
- [Use the manual method.](#offlinetroubleshooting-manualvm)
160158

161-
### <a id="offlinetroubleshooting-repairvm"></a>Use Azure Linux Auto Repair (ALAR)
159+
### <a id="offlinetroubleshooting-repairvm"></a>Use az vm repair
162160

163-
Azure Linux Auto Repair (ALAR) scripts are a part of the VM repair extension described in [Repair a Linux VM by using the Azure Virtual Machine repair commands](repair-linux-vm-using-azure-virtual-machine-repair-commands.md).
161+
The `az vm repair`, part of the vm-repair extension for the Azure CLI, is described in [Repair a Linux VM by using the Azure Virtual Machine repair commands](repair-linux-vm-using-azure-virtual-machine-repair-commands.md).
164162

165163
Follow these steps to automate the manual offline process:
166164

@@ -177,7 +175,7 @@ Follow these steps to automate the manual offline process:
177175

178176
3. Run the following commands to resolve the permission and ownership issues:
179177

180-
### [RHEL/CentOS](#tab/rhelts3)
178+
### [RHEL](#tab/rhelts3)
181179

182180
```bash
183181
mkdir -p /var/empty/sshd
@@ -210,11 +208,11 @@ Follow these steps to automate the manual offline process:
210208

211209
### <a id="offlinetroubleshooting-manualvm"></a>Use the manual method
212210

213-
If both the serial console and ALAR approach don't apply to you or fail, the repair has to be performed manually. Follow the steps below to manually attach the OS disk to a recovery VM and swap the OS disk back to the original VM:
211+
If both the serial console and `az vm repair` approach don't apply to you or fail, the repair has to be performed manually. Follow the steps below to manually attach the OS disk to a recovery VM and swap the OS disk back to the original VM:
214212

215213
- [Attach the OS disk to a recovery VM using the Azure portal.](troubleshoot-recovery-disks-portal-linux.md)
216214
- [Attach the OS disk to a recovery VM using Azure CLI.](troubleshoot-recovery-disks-linux.md)
217215

218-
Once the OS disk is successfully attached to the recovery VM, follow the detailed [chroot instructions](chroot-environment-linux.md) to mount and chroot to the filesystems of the attached OS disk. Then, follow step 3 in the [Use Azure Linux Auto Repair (ALAR)](#offlinetroubleshooting-repairvm) section to resolve the permission and ownership issues.
216+
Once the OS disk is successfully attached to the recovery VM, follow the detailed [chroot instructions](chroot-environment-linux.md) to mount and chroot to the filesystems of the attached OS disk. Then, follow step 3 in the [Use az vm repair](#offlinetroubleshooting-repairvm) section to resolve the permission and ownership issues.
219217

220218
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)