Ask Your Question

Sofia is not in the sudoers file [closed]

asked 2012-04-19 08:20:37 -0600

figueiredoepedro gravatar image

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


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Akshay
close date 2013-07-16 10:01:47.626698

6 Answers

Sort by » oldest newest most voted

answered 2012-07-15 22:29:07 -0600

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 :

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 link more

answered 2012-04-19 10:21:58 -0600

lanmaster82 gravatar image

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 link more

answered 2013-07-16 06:23:41 -0600

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 link more

answered 2012-07-15 05:17:33 -0600

Iman gravatar image

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

edit flag offensive delete link more


Worked for me. Log out and in to see changes.

cip_fedora gravatar imagecip_fedora ( 2018-03-30 06:57:56 -0600 )edit

answered 2012-07-16 10:48:22 -0600

this post is marked as community wiki

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

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

edit flag offensive delete link more

answered 2012-07-15 06:04:59 -0600

wis775 gravatar image

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

For the documentation about "easyLife", please see

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

edit flag offensive delete link more

Question Tools


Asked: 2012-04-19 08:20:37 -0600

Seen: 36,842 times

Last updated: Jul 16 '13