O'Reilly logo

CompTIA Linux+ Certification Guide by Philip Inshanally

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required