Configure sudo and add user to sudoers group on Debian

Configure sudo and add user to sudoers group on Debian

Configure sudo and add user to sudoers group on Debian

In this article you will learn how to configure sudo and add user to sudoers group on Debian. This method will work both desktop and server versions of Debian.

About sudo

sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for “superuser do” as the older versions of sudo were designed to run commands only as the superuser. Source: Wikipedia

Installing sudo on Debian

Fire up you terminal and run the following commands as root. You can turn normal user to root on debian by simply using su command.

Updating repositories
apt-get update
Installing sudo
apt-get install sudo

Configuring your user to sudoers group

Now you have got sudo installed on your system, next thing you must do is to configure your user to be permitted to use it.
Add your user to the sudo group with the following command. Replace “user” with your username without quotes.
adduser "user" sudo

Now you need to open up file /etc/sudoers with your favorite text editor as root. I will just be using gedit since I am using Debian on GNOME 3 desktop.
Add your username under sudo like this:

%sudo ALL=(ALL:ALL) ALL
"user" ALL=(ALL:ALL) ALL

Save and close.

Congratulations. You have just learned how to configure and add user to sudoers group on Debian GNU/Linux. I hope you liked my tutorial and found it useful! Please follow me on social media to keep in touch with my articles! Have a great day!

You might also want to check out these interesting articles on my blog:
Remove all games from GNOME 3 with just one command.
Scan open ports with Nmap and install latest version of Nmap

Related posts

2 Thoughts to “Configure sudo and add user to sudoers group on Debian”

  1. Karthik

    My sudo is screwed up after following this post. I dont know what to do

    1. Admin

      You must have done something incorrectly, what output are you getting when you try to use sudo? I’m willing to help here.

Leave a Comment