CompTIA Linux+ (XK0-004) — Question 18
A Linux server needs to be accessed, but the root password is not available.
Which of the following would BEST allow an administrator to regain access and set a new known password at the same time?
Answer options
- A. Boot into single-user mode and reset the password via the passwd command.
- B. Boot into single-user mode and reset the password by editing the /etc/passwd file.
- C. Boot into single-user mode and reset the password by editing the /etc/shadow file.
- D. Boot into single-user mode and reset the password via the chage command.
Correct answer: A
Explanation
The correct option is A because booting into single-user mode allows the administrator to use the passwd command to reset the root password directly. Options B and C involve editing files that are not intended for direct password modification, which can lead to system errors, while option D is used for managing password aging rather than resetting the password itself.