Ask Your Question

Sofia is not in the sudoers file [closed]

asked 2012-04-19 13:20:37 +0000

figueiredoepedro gravatar image

Hello, how can I solve this problem: "Sofia is not in the sudoers file"?


edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, right answer was accepted" by Akshay
close date 2013-07-16 15:01:47.626698

6 Answers

Sort by » oldest newest most voted

answered 2012-07-16 03:29:07 +0000

While the other answers are potential solutions, they are not IMO the best.

First, IMO, when editing /etc/sudoers you should use visudo . visudo checks for syntax errors in your edit.

If you do not like vi, you can use any editor you wish.

EDITOR=gedit visudo

Second you can add your user to the wheel group with usermod as suggested by Iman. Just take care with the usermod, you probably want to use the -a option (for append)

su -c "usermod -a -G wheel username"

You probably do not want to use -g as it sets the default login group ;)

see man usermod for details.

You will need to log out and back in for this to take effect.

Third, I advise against the "NOPASSWD" option as this allows one to run commands as root without a password. It is sort of a minor issue, but figueiredoepedro was not asking to run sudo without a password so the given answer may have unintended consequences.

The wheel group is default in Fedora:

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)   ALL

If you prefer to specify a user, I suggest

username  ALL=(ALL)   ALL

See also : http://www.gratisoft.us/sudo/sudoers.man.html

One last tip, if you confine your users, staff_u has sudo access.


%wheel ALL=(ALL) TYPE=unconfined_t ROLE=unconfined_r ALL


username ALL=(ALL) TYPE=unconfined_t ROLE=unconfined_r ALL
edit flag offensive delete publish link more

answered 2012-04-19 15:21:58 +0000

Open gnome-terminal and type the following:

$ su -
Password [type in the root password here]

Your bash line will change from $ to # indicating that you are now using the root account. At this point you’re going to use a text editor to modify the file /etc/sudoers. My preferred graphical editor is gedit.

# gedit /etc/sudoers

Once the document is open you will scroll down until you see:

## Allow root to run any commands anywhere
root            ALL=(ALL)     ALL

Simply append that section with your user account and save the file. You will need to log out so that the sudoers parameters propagates the system. Let’s pretend that your user account is testuser.

## Allow root to run any commands anywhere
root            ALL=(ALL)     ALL
testuser     ALL=(ALL)     NOPASSWD: ALL
edit flag offensive delete publish link more

answered 2012-07-15 11:04:59 +0000

wis775 gravatar image

You can add your user to the sudoers by using an application called "easylife"

For the documentation about "easyLife", please see http://www.easylifeproject.org/

With "easyLife", you can do much more convenience actions on your system like installing Java, Flash or some multimedia Codecs.

edit flag offensive delete publish link more

answered 2012-07-15 10:17:33 +0000

Iman gravatar image

just run this command:
su -c "usermod -g wheel username"

edit flag offensive delete publish link more

answered 2013-07-16 11:23:41 +0000

ffabreti gravatar image

I'm on Fedora 19 and did this:

  1. press <ctrl> + <alt> + <F2> and login as root
  2. chmod 640 /etc/sudoers
  3. vi /etc/sudoers insert line <username> ALL=(ALL) ALL at end of file
  4. save and exit
  5. chmod 440 /etc/sudoers
  6. press <ctrl> + <alt> + <F1> to go back to Gnome
  7. open up a terminal window and type your sudo command
edit flag offensive delete publish link more

answered 2012-07-16 15:48:22 +0000

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2012-07-16 15:48:22 +0000

echo “NameUser ALL=(ALL) ALL” >> /etc/sudoers

edit flag offensive delete publish link more

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers to your questions.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.


Asked: 2012-04-19 13:20:37 +0000

Seen: 12,262 times

Last updated: Jul 16 '13