GSEC · Question #164
You work as a Linux technician for Tech Perfect Inc. You have lost the password of the root. You want to provide a new password. Which of the following steps will you take to accomplish the task?
The correct answer is D. Reboot the computer in run level 1. In Linux, run level 1 (single-user mode) provides a root shell without requiring authentication, allowing a lost root password to be reset.
Question
You work as a Linux technician for Tech Perfect Inc. You have lost the password of the root. You want to provide a new password. Which of the following steps will you take to accomplish the task?
Options
- AThe password of the root user cannot be changed.
- BUse the PASSWD root command.
- CReboot the computer in run level 0. Use INIT=/bin/sh as a boot option.
- DReboot the computer in run level 1.
How the community answered
(37 responses)- A14% (5)
- B5% (2)
- C3% (1)
- D78% (29)
Why each option
In Linux, run level 1 (single-user mode) provides a root shell without requiring authentication, allowing a lost root password to be reset.
The root password can always be reset through recovery methods such as single-user mode or a live boot environment - it is never permanently irrecoverable.
The correct command syntax is lowercase 'passwd root'; however, even with correct syntax, running this command requires an authenticated root session, which is unavailable when the root password is lost.
Run level 0 is the halt or shutdown state - booting to run level 0 powers off the system immediately and does not provide a shell for password recovery.
Rebooting into run level 1 starts Linux in single-user mode, which drops to a root shell without prompting for a password. From this shell, the administrator can execute the 'passwd' command to set a new root password and then reboot into the normal multi-user run level.
Concept tested: Linux root password recovery using single-user mode
Source: https://man7.org/linux/man-pages/man8/init.8.html
Topics
Community Discussion
No community discussion yet for this question.