The Power of Sudo

In this chapter, you will learn how to give permissions to non-root users on the system so they can run privileged commands. In real life, the system administrator should not give the root password to any user on the system. However, some users on the system may need to run privileged commands; now, the question is: how can non-root users run privileged commands without getting root access to the system? Well, let me show you!

Examples of privileged commands

You would find most of the commands that require root privileges in the directories /sbin and /usr/sbin. Let’s switch to user smurf:

elliot@ubuntu-linux:~$ su - smurf Password:smurf@ubuntu-linux:~$

Now let’s see if smurf can add a new user to the system:

smurf@ubuntu-linux:~$ ...

Get Learn Linux Quickly now with O’Reilly online learning.

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