nerdexam
CompTIA

XK0-005 · Question #152

An administrator is uncomfortable allowing users to log in as root. Which of the following ensures that root logins are disallowed?

The correct answer is A. usermod -L root. The usermod -L flag locks a user account by prepending an exclamation mark (!) to the encrypted password in /etc/shadow, effectively preventing password-based login. Using usermod -L root locks the root account, disallowing direct root logins. Option B (-G) modifies group…

System Management

Question

An administrator is uncomfortable allowing users to log in as root. Which of the following ensures that root logins are disallowed?

Options

  • Ausermod -L root
  • Busermod -G root
  • Cusermod -B root
  • Dusermod -U root

How the community answered

(29 responses)
  • A
    86% (25)
  • B
    7% (2)
  • C
    3% (1)
  • D
    3% (1)

Explanation

The usermod -L flag locks a user account by prepending an exclamation mark (!) to the encrypted password in /etc/shadow, effectively preventing password-based login. Using usermod -L root locks the root account, disallowing direct root logins. Option B (-G) modifies group membership, option C (-B) is not a valid usermod flag, and option D (-U) is the opposite - it unlocks a previously locked account.

Topics

#User management#Account security#Linux commands#usermod

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice