• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2817
  • Last Modified:

username is not in the sudoers file


I just installed Mandriva 2010 on one of my maschines since I'm having a course in Linux in school later this month.
The installation works just fine and not a single problem during setup.
But when I open up the console and type "sudo -i" and then my password I get the error:

"andreas is not in the sudoers file. This incident will be reported"

I found on antother forum a way that has worked for some users.
Press Ctrl + Alt + F1
Log in as root (Here my password works)
Type: "Visudo"
Add the following under root: YourUsernameHere   ALL=(ALL) SETENV: ALL
Save and exit

But I still have the same problem.

My password is: Proxy
username: andreas
(Since this is a standalone computer and the password is only used here I can write it out)

Any help on how to fix this problem is greatly appriciated!
I've been using Ubuntu before but converted to Windows again. So I'm not a complete newbie on Linux, but far from any good aswell!
  • 6
  • 5
1 Solution
Hello Andreas. Try adding this line in the sudoers file

andreas ALL=(ALL) ALL
Raver87Author Commented:
Tried that aswell, but it didn't work.
If I open up the terminal and write:
I get logged in to [root@localhost andreas]
As the user andreas, if you type

sudo -l

and enter 'Proxy' as the password, you should see

User andreas may run the following commands on this host:
    (ALL) ALL
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Raver87Author Commented:
Hmm, this was strange...

Just typed sudo -l and the first time it didn't accept the password.
But the second time it worked =/

And I'm sure I typed the right password and I haven't changed the file afterwards.
Anyone knows what is happening?
It's not always 100% possible to know you've typed the wrong password.  I've done the same thing many times in the past where I swore I typed the correct password, only to try again and got it right.
Raver87Author Commented:
Well thsi time it took about 5 reboots and 20 times entering the password =P
One last question though, why is it I need to edit the sudoers file to get it to work?
Could be good to know in the future =)

I never had this problem running Ubuntu. Remember I hade the same problem when I installed Fedora on a virtual machine in VmWare, but then I thought it had something to do with vmware and gave up ^^
By default, sudoers will contain no entries.  You need to add them after it is installed.
Raver87Author Commented:
How come I need to add the entry now?
Never had this problem before? Since this is the only account I don't really understand...
If I created several different I would have understood it.
Are you saying that on the same server you previously had sudo access and then it disappeared?  If so, perhaps the OS or sudo was upgraded and lost your sudoers settings.
Raver87Author Commented:
Well, no. This was a clean installation. I just wanted to know if this is a common problem.
I just installed Fedora on another machine and now I have the same problem there.
I can't use "Sudo"...
As previously stated, the default install of sudo will *not* have any sudo entries for standard users.  You need to add them.
Raver87Author Commented:
Okay, any idea on how to do this in Fedora?
I know it's not in the right category and it should be another question. But there's nothing wrong with asking ^^

I tried pressing Alt + Ctrl + F1 but with no luck. Is it another combination in Fedora?
Runing the latest release with KDE.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now