How to enable sudo on Debian 10?

Windows Articles

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...
angeloma
angeloma
Senior Writer and partner

Debian 10 has come out of the oven. It is great news for all users of this great Linux distribution. However, it is also great for all of us who use Linux. If like me, you have just installed it, you will notice that your regular user cannot use sudo. And if you come from using Ubuntu or Linux Mint, then surely you miss it. So this post will show you how to enable sudo on Debian 10.

Introduction – What is sudo?

In a PC that runs some Linux distribution, there are different users. Each of them has defined roles and permits. For example, to install a package in Debian it is necessary to do it with root user privileges. Then, not all users can do all things.

The sudo program is part of the GNU suite. It is a small application that allows the execution of commands with the security privileges of another user. Normally, this “other” user is root.

By Debian security policy, this program is not enabled for your regular user. And the truth is that if you use Debian on your personal computer we can enable it and it would not be a problem. However, if you install Debian to be used on a server, you should not do it.

In any case, sudo allows you to execute commands that your user can not. In addition, the commands that are applied with sudo are not registered in the system log.

Enable sudo on Debian 10

Depending on how you installed Debian 10, Buster, sudo may not have been installed by default. This is normal, actually. So first you have to install it and for that, you need to have access to the root user of the system. This is vital.

So, open a terminal or connect to your server using SSH.

:~$ su

Then, you will have to enter the root user key. If you did the installation, there should be no problem.

After that, you can install sudo from the Debian repositories.

:~# apt install sudo

Sudo is quite light so the installation is quite fast.

Now you have to modify the file /etc/sudoers which is where all the sudo configuration is located. You can use the nano editor for this.

:~# nano /etc/sudoers

The file does not have too many lines. In the user privilege specification section, you will find a line like this.

root ALL=(ALL:ALL) ALL

Under it, add your user and leave the rest the same. Something like that.

your-user ALL=(ALL:ALL) ALL

1.- Enable sudo on Debian 10
1.- Enable sudo on Debian 10

Next, press CTRL + O to save the changes and CTRL +X to close it.

After that, you can use sudo.

So, share this post with your friends and join our Telegram Channel.

More articles

4 COMMENTS

  1. Thank you …this was the only working tutorial i found in the web …a big shame on debian forums because they making bashing against each other …but no useful information.
    it seems Debian is on a wrong way…they like to be like ubuntu or some other “userfriedly” distribution
    now in debian buster they use clear the wrong way ….they force the user to change their habits
    Before i found your tutorial i was close to remove debian 10 from the hard drive and install free bsd because its much simpler as the modern garbage in debian 10.
    in a car i like to crank the window per hand ..its simple and useful …no electronics can fail and in a operating system i like also the simple and stupid methodes to administrate everything. But what should i do when they remove the god old simple things ?…throw the computer out of the window ?
    sorry for my emotional comment,but i work the whole evening on this silly ..sudo problem…wastig time
    and sorry for my bad english
    thank you again an good bye

  2. Well, first of all you don’t need to install and configure sudo if you actually *read* what the Debian Installer tells you. When asking to set root password it explicitly says that you can leave it blank, and then the root account will be locked, and the user you add later on will be configured to use sudo by default.

    Then, manually editing /etc/sudoers is not needed – just add your user to the ‘sudo’ group with:
    # adduser sudo

    Finally, *DO NOT* edit /etc/sudoers strait with an editor! One mistake – and you may be locked out of using sudo, and if the root account is already locked, you’re screwed. Use ‘visudo’ – it checks if your edits are correct before applying them.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to create GPO in Windows Server 2019.

Hi, in today's post we will be looking at GPOs in Windows Server 2019. The Group Police Object are a set of...

How to install OpenLiteSpeed on Ubuntu 20.04?

There are several web servers for Linux but other alternatives are always welcome. In this case, I will show you how to...

Linux 5.7 available

Time passes very quickly and we already have a new version of the Linux kernel that as always we are happy because...

How to install RStudio on Ubuntu 20.04 / 18.04

No matter how complete and robust a programming language is, the programmer will always need a tool to write the code. These programs have...

How to install Arduino IDE on Ubuntu 20.04 / 18.04 / Linux Mint 19.X?

Hi, folks. In this post, we will show you how to install Arduino IDE on Ubuntu 20.04/ 18.04 and Linux mint 19.x. You probably already...