Debian Linux – Adding User to Sudoers File

Hi Everyone, After I installed a fresh install of Debian 6.0.3 amd64 from DVD, it was a smooth install. Then I went to update my system and download the updates.
I went to use sudo command as you do. Well I tried and it said my userid was not in the sudoers file, so I searched and found how to correct this and add my userid to the sudoers file.

User is not in the sudoers file. How to add the user to the sudoers file?

All you need to do is add the following line to the sudoers file in /etc/sudoers
user_name   ALL=(ALL) ALL
Replace user_name with your own user ID

Follow the below instructions:
open a new terminal, switch to root, type “su”
then enter the root password,
type “gedit /etc/sudoers” and you will see the sudoers file opened for editing in the file look for the following line.

You can also enter the command in one line and enter your root password when asked.
In the terminal window copy & paste this line without the Quotation Marks. “su gedit /etc/sudoers

user_name  ALL=(ALL) ALL
Again, Make sure you replace user_name with your own user ID

SAVE the file and then exit & try your command you were trying to use before and voila!


This works for all Debian Linux versions from 6.0 onwards, it would be nice if this was automatically done when creating a user. Perhaps more feedback to Debian about this little issue.

One thought on “Debian Linux – Adding User to Sudoers File

  1. Pingback: Trying Debian Jessie | Experiments in Freedom

Comments are closed.