Skip to content

Commit 72cbbf7

Browse files
authored
Merge pull request #8798 from mabicca/patch-8
AB#5586: Update serial-console-grub-single-user-mode.md
2 parents bfde22d + 55bda80 commit 72cbbf7

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

support/azure/virtual-machines/linux/serial-console-grub-single-user-mode.md

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ms.author: genli
2222

2323
[!INCLUDE [CentOS End Of Life](../../../includes/centos-end-of-life-note.md)]
2424

25-
GRand Unified Bootloader (GRUB) is likely the first thing you see when you boot a virtual machine (VM). Because it's displayed before the operating system has started, GRUB isn't accessible via SSH. In GRUB, you can modify your boot configuration to boot into single-user mode, among other things.
25+
Grand Unified Bootloader (GRUB) operates at an early stage in a Linux virtual machine (VM) boot process. It operates before the Linux kernel is loaded and before any system services (such as networking or SSH) are started, so GRUB isn't accessible via SSH. You must use the Serial Console to access GRUB. In GRUB, you can modify your boot configuration to boot into single-user mode, among other things.
2626

2727
Single-user mode is a minimal environment with minimal functionality. It can be useful for investigating boot issues, file system issues, or network issues. Fewer services can run in the background and, depending on the runlevel, a file system might not even be automatically mounted.
2828

@@ -31,7 +31,7 @@ Single-user mode is also useful in situations where your VM might be configured
3131
> [!NOTE]
3232
> The Serial Console service allows only users with *contributor* level or higher permissions to access the serial console of a VM.
3333
34-
To enter single-user mode, enter GRUB when your VM is booting, and modify the boot configuration in GRUB. See detailed instructions for entering GRUB in the next section. In general, if your VM has been configured to display GRUB, you can use the restart button within your VM's serial console to restart the VM and display GRUB.
34+
To enter single-user mode, enter GRUB when your VM is booting, and modify the boot configuration in GRUB. See detailed instructions for entering GRUB in the next section. If your VM is set up to display GRUB, you can use the restart button within your VM's serial console to restart the VM and display GRUB.
3535

3636
:::image type="content" source="media/serial-console-grub-single-user-mode/restart-vm-button.png" alt-text="Screenshot of the Restart VM button displayed in the tool bar." border="false":::
3737

@@ -51,7 +51,7 @@ You can also restart your VM by running a SysRq "b" command if [SysRq](./serial-
5151

5252
## General single-user mode access
5353

54-
You might need manual access to single-user mode when you haven't configured an account with password authentication. Modify the GRUB configuration to manually enter single-user mode. After you've done this, see the "Use single-user mode to reset or add a password" section for further instructions.
54+
You might need manual access to single-user mode when you haven't configured an account with password authentication. Modify the GRUB configuration to manually enter single-user mode. After doing this, see the "Use single-user mode to reset or add a password" section for further instructions.
5555

5656
If the VM is unable to boot, distributions often automatically drop you into single-user mode or emergency mode. Other distributions, however, require additional setup, such as setting up a root password, before they can drop you into single-user or emergency mode automatically.
5757

@@ -63,10 +63,6 @@ After you're in single-user mode, add a new user with sudo privileges by doing t
6363
1. Run `sudo usermod -a -G sudo <username>` to grant the new user root privileges.
6464
1. Use `passwd <username>` to set the password for the new user. You can then sign in as the new user.
6565

66-
## Access for Red Hat Enterprise Linux (RHEL)
67-
68-
If RHEL can't boot normally, it drops you into single-user mode automatically. However, if you haven't set up root access for single-user mode, you don't have a root password and can't sign in. There is a workaround (see the "Manually enter single-user mode in RHEL" section), but we suggest that you set up root access initially.
69-
7066
### GRUB access in RHEL
7167

7268
RHEL comes with GRUB enabled out of the box. To enter GRUB, reboot your VM by running `sudo reboot`, and then press any key. The GRUB pane should be displayed. If it isn't, ensure that the following lines are present in your GRUB file (`/etc/default/grub`):
@@ -93,21 +89,9 @@ GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200
9389
> [!NOTE]
9490
> Red Hat also provides documentation for booting into Rescue Mode, Emergency Mode, or Debug Mode, and for resetting the root password. For instructions, see [Terminal menu editing during boot](https://aka.ms/rhel7grubterminal).
9591
96-
### Set up root access for single-user mode in RHEL
97-
98-
The root user is disabled by default. Single-user mode in RHEL requires the root user to be enabled. If you need to enable single-user mode, use the following instructions:
99-
100-
1. Sign in to the Red Hat system via SSH.
101-
1. Switch to root.
102-
1. Enable the password for the root user by doing the following:
103-
* Run `passwd root` (set a strong root password).
104-
1. Ensure that the root user can sign in only via ttyS0 by doing the following:
105-
a. Run `vi /etc/ssh/sshd_config`, and ensure that PermitRootLogIn is set to `no`.
106-
b. Run `vi /etc/securetty file` to allow sign-in only via ttyS0.
107-
108-
Now, if the system boots into single-user mode, you can sign in with the root password.
92+
### Single-User mode in RHEL 6.9+ and 7.4+
10993

110-
Alternatively, for RHEL 7.4+ or 6.9+, to enable single-user mode in the GRUB prompts, see [Booting into single-user mode](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/installation_guide/s1-rescuemode-booting-single).
94+
For RHEL 7.4+ or 6.9+, to enable single-user mode in the GRUB prompts, see [Booting into single-user mode](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/installation_guide/s1-rescuemode-booting-single).
11195

11296
### Manually enter single-user mode in RHEL
11397

@@ -274,7 +258,6 @@ To enable single-user mode in Oracle Linux, follow the earlier instructions for
274258
To learn more about Serial Console, see:
275259

276260
* [Linux Serial Console documentation](serial-console-linux.md)
277-
* [Use Serial Console to enable GRUB in various distributions](https://linuxonazure.azurewebsites.net/why-proactively-ensuring-you-have-access-to-grub-and-sysrq-in-your-linux-vm-could-save-you-lots-of-down-time/)
278261
* [Use Serial Console for NMI and SysRq calls](serial-console-nmi-sysrq.md)
279262
* [Serial Console for Windows VMs](../windows/serial-console-windows.md)
280263
* [Boot diagnostics](../windows/boot-diagnostics.md)

0 commit comments

Comments
 (0)