Which command allows a standard user account to run commands as another user account, including the root user account?

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!

The command that allows a standard user account to run commands as another user account, including the root user account, is "sudo." This command stands for "superuser do" and enables users to execute commands with elevated privileges. When a user types "sudo" before a command, they are prompted to enter their own password, and if they have the necessary permissions configured in the "/etc/sudoers" file, the command will execute with the privileges of the root user or any specified user.

Using "sudo" is favored in many Linux distributions because it allows for fine-grained control over who can run what commands and reduces the security risks that come from giving users access to the root account directly. It also creates logs of commands that have been executed, adding an additional layer of accountability.

In contrast, the other commands do not provide the same functionality in the context of elevating user privileges for executing commands. "su" allows users to switch user accounts, but it requires the password of the target user (usually root) and is less secure in multi-user environments. "visudo" is used for safely editing the "/etc/sudoers" file, and "sudoedit" is a variant of "sudo" that allows users to edit files

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy