Linux and Command-Line Basics

Which of the following correctly describes the sudo command on Linux?

  1. AAnyone who knows the root password can run a command prefixed with sudo, and no record of who ran it is kept anywhere
  2. BA command prefixed with sudo is given a higher priority by the kernel than other processes and runs faster because it can use the CPU first
  3. CIt lets a user permitted in sudoers run a command with the privileges of another user (root by default), and by default the user enters their own password
Show answer and explanation

Answer: C. It lets a user permitted in sudoers run a command with the privileges of another user (root by default), and by default the user enters their own password

root is the administrator account (superuser) that can operate everything on the system, essentially without the restrictions of file permissions. sudo is a mechanism that lets only users permitted in /etc/sudoers or similar run individual commands with the privileges of root or another user; by default it confirms with the user's own password and records the commands run. Compared with sharing the root password and always logging in as root, it makes it easier to trace who did what, and strong privileges are used only when needed. Keeping privileges to the minimum necessary is based on the principle of least privilege in security.

  • A. Only users permitted in sudoers can use sudo, and with the default settings the commands run are recorded.
  • B. Changing processing priority is done with nice or renice. sudo changes privileges and does not change speed.
  • C. Correct. A permitted user runs only the needed commands with another user's privileges.
Practice this topic Back to topic

Books on Linux and Command-Line Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Linux and Command-Line Basics questions

  1. On many Linux systems, "ls -l /usr/bin/passwd" shows "-rwsr-xr-x 1 root root ...". Which of the following is the meaning of the "s" in the owner's execute position?
  2. When the commands above are run in order, which of the following is the content shown by the last cat?
  3. As shown above, in a directory where a.txt exists and nofile does not, the last command is run. Which of the following is the result?
  4. In the session above, which of the following is the value printed by the last command?
  5. In the session above, which of the following are the lines printed by the last grep?