Managing Sudo Permissions

Hands-On Lab

 

Photo of Bob Salmans

Bob Salmans

Security Training Architect I in Content

Length

00:30:00

Difficulty

Beginner

In this lab, we will take a look at how to give a user account permissions to use sudo. We will accomplish this task by adding the user to the sudoers file, which will then allow the user to use the sudo command.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Managing Sudo Permissions

In this lab, we will take a look at how to give a user account permissions to use sudo. There's more than one way to accomplish this task, so we'll take a look at two ways in particular.

Open a terminal, and log in to the cloud server using the provided credentials.

Create a New User Account

  1. To create the new user account, use the following command:

    sudo adduser hpotter

    When prompted for the password, enter:

    ButterB33r!

Add User to sudoers File

  1. To add a new user account to the sudoers file, run the following command:

    sudo visudo
  2. In the User privilege specification section, add the following line:

    hpotter ALL=(ALL:ALL) ALL  
  3. Exit the file, saving the changes.

Conclusion

Congratulations on completing this hands-on lab!