-   Debian (
-   -   User is not in the sudoers file (

khinch 03-27-2012 03:02 PM

User is not in the sudoers file
Hi, I'm new to Debian although I've been using Linux for a while. I just completed a fresh install of Debian 6.0.4 and started to configure my system the way I like it. I tried to give myself sudo privileges:
  • I added "wheel ALL=(ALL) ALL" to the end of the sudoers file using visudo
  • I then typed "addgroup wheel"
  • then "adduser <username> wheel" (obviously substituting my own username for <username>)
I then logged out and back in again, and thought this would be enough to give myself sudo privileges, but I still get the message "<user> is not in the sudoers file. This incident will be reported".

If I add myself to the sudoers file manually it works fine, so I can get around this problem. But, why doesn't it work via the wheel method? It seems much easier to administer users of a system if I can just add them to wheel instead of adding them to the sudoers file manually.

Any help much appreciated.

craigevil 03-27-2012 03:04 PM

Why mess with sudo at all? How hard is it to do su?

adduser name sudo

$ groups
craig lp cdrom floppy sudo audio dip video plugdev users netdev lpadmin powerdev scanner debian-tor

khinch 03-27-2012 05:44 PM

Thanks for replying.

It's not hard to su, but I've had issues in the past with applications that need to run as myself, but with sudo privileges. Truecrypt for instance. I seem to recall the only way I can mount encrypted volumes with truecrypt is if it runs as myself via sudo.

I tried adding myself to the sudo group, but the error still occurs. The only thing that seems to work is adding my username into the sudoers file manually (username ALL=(ALL) ALL). I just wondered if there was a reason why, and if there's a more elegant way around it.

TobiSGD 03-27-2012 05:47 PM


Originally Posted by khinch (Post 4637972)
I added "wheel ALL=(ALL) ALL" to the end of the sudoers file using visudo

Shouldn't that be

%wheel ALL=(ALL) ALL
Otherwise sudo mistakes wheel for a user, not a group.

craigevil 03-27-2012 07:17 PM

My sudoers file has:


# Allow members of group sudo to execute any command
%sudo  ALL=(ALL:ALL) ALL

Rather than wheel and my user is in the sudo group.

Never used Truecrypt, I encrypt my entire drive during install and use ccrypt for individual files/folders.


Description-en: secure encryption and decryption of files and streams
ccrypt is a utility for encrypting and decrypting files and streams. It was
designed as a replacement for the standard unix crypt utility, which is
notorious for using a very weak encryption algorithm. ccrypt is based on the
Rijndael cipher, which is the U.S. government's chosen candidate for the
Advanced Encryption Standard (AES, see This cipher is
believed to provide very strong security.

khinch 03-28-2012 01:27 PM


Originally Posted by TobiSGD (Post 4638083)
Shouldn't that be

%wheel ALL=(ALL) ALL

Yes. And I didn't have the % at the start. Problem solved.


Edit: Thanks to craigevil too. I use Truecrypt for cross platform compatibility btw.

All times are GMT -5. The time now is 09:38 AM.