Sofia is not in the sudoers file [closed]
Hello, how can I solve this problem: "Sofia is not in the sudoers file"?
Thanks
Hello, how can I solve this problem: "Sofia is not in the sudoers file"?
Thanks
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.
Use
%wheel ALL=(ALL) TYPE=unconfined_t ROLE=unconfined_r ALL
Or
username ALL=(ALL) TYPE=unconfined_t ROLE=unconfined_r ALL
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
I'm on Fedora 19 and did this:
<ctrl> + <alt> + <F2>
and login as rootchmod 640 /etc/sudoers
vi /etc/sudoers
insert line <username> ALL=(ALL) ALL
at end of filechmod 440 /etc/sudoers
<ctrl> + <alt> + <F1>
to go back to Gnomejust run this command:
su -c "usermod -g wheel username"
answered 2012-07-16 10:48:22 -0600
This post is a wiki. Anyone with karma >750 is welcome to improve it.
echo “NameUser ALL=(ALL) ALL” >> /etc/sudoers
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.
Asked: 2012-04-19 08:20:37 -0600
Seen: 36,841 times
Last updated: Jul 16 '13