The sudo command

The sudo command solves the dilemma of standard users needing the root password, as long as the user's account resides in the /etc/sudoers configuration file. The basic syntax of the sudo command is as follows:

sudo <command>

Along with the preceding command, we simply specify the command that we would like to execute, which would normally require root privileges. Let's try the sudo command as follows:

[philip@localhost ~]$ sudo ls /boot/grub2/[sudo] password for philip:device.map  fonts  grub.cfg  grubenv  i386-pc  locale  themes[philip@localhost ~]$

Excellent! When we executed the sudo command and passed the command that required root privileges, we were prompted for the password of the standard user, not the root user. Afterwards, ...

Get CompTIA Linux+ Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.