Which file would you edit to give root user privileges to someone else?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

Editing the /etc/sudoers file is the correct approach to grant root user privileges to another user in a Linux system. This file controls who can run commands as the root user or other users and specifies the permissions associated with those commands. By adding a user to this file with the appropriate configuration, that user can execute commands as root by using the sudo command.

The sudoers file allows for specific user and group configurations, ensuring that only authorized users are allowed elevated privileges. It is important to edit this file using the visudo command, which provides syntax checking to prevent errors that could inadvertently lock out all users from sudo access.

Other files mentioned serve different purposes. The /etc/passwd file contains user account information, such as usernames and user IDs, but it does not dictate privilege levels. The /etc/group file manages group memberships and permissions but doesn't provide access control for executing commands as root. The /etc/shadow file stores password hashes and related information securely and has no role in user privilege management.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy