Sudo and Sudoers File

Libiaestevez
2 min readJun 2, 2021

Get started with Linux

The world of Linux is ready

Understanding the Sudo command

sudo in Linux or Unix Operating System environment is a abbrevation of “super-user do”.
The power of running a command with this privileges its bigger.

The Sudoers File

The sudo command is configured through a file located in /etc/ called sudoers.
You can configurate users to able to run as sudo that can be done by editing sudoers file.
Important: Be careful! Editing the sudoers file, with errors or bad syntax may result in locking out all users on your distribution.

A picture is worth a thousand words, as the picture tells us much more than words.

User Privilege Specification Lines

Group Privilege Specification Lines

The next line is similar to the user privilege line 👆, but names beginning with a %.

You are in / etc / sudoers

It’s a trick of a ctf to check sudoers,if there are commands that we can execute as root without using a password, we can abuse them. Let’s imagine the following scenario:

What commands a usually www-data user, or any other user has with which we enter, can execute as super user, you need to execute the command:

sudo -l

I hope you like.

--

--