Which approach enables a user to run any command without a password in sudo?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which approach enables a user to run any command without a password in sudo?

Explanation:
To let a user run any command with sudo without being prompted for a password, you configure the sudoers file to permit that without a password. The safe, correct method is to edit /etc/sudoers using visudo and add a line like "username ALL=(ALL) NOPASSWD: ALL." This entry tells sudo that this user may run any command as any user on all hosts without needing to enter a password. Using visudo matters because it validates syntax and prevents configuration errors that could lock you out of sudo. Other options don’t achieve this: changing the user’s shell has no effect on sudo authentication; simply adding the user to the wheel group only helps if the sudoers configuration already grants wheel members sudo access (and with or without a password, only if NOPASSWD is specified); and locking the user’s password prevents login and does not grant passwordless sudo.

To let a user run any command with sudo without being prompted for a password, you configure the sudoers file to permit that without a password. The safe, correct method is to edit /etc/sudoers using visudo and add a line like "username ALL=(ALL) NOPASSWD: ALL." This entry tells sudo that this user may run any command as any user on all hosts without needing to enter a password. Using visudo matters because it validates syntax and prevents configuration errors that could lock you out of sudo. Other options don’t achieve this: changing the user’s shell has no effect on sudo authentication; simply adding the user to the wheel group only helps if the sudoers configuration already grants wheel members sudo access (and with or without a password, only if NOPASSWD is specified); and locking the user’s password prevents login and does not grant passwordless sudo.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy