Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-24-2014, 08:02 AM   #1
Registered: Aug 2009
Posts: 349

Rep: Reputation: 16
adding user to sudo

So i just configured this laptop and the main user was not in the sudoers

[FEDORA_CASPER@new-host-3 ~]$ cat /etc/issue
Fedora release 20 (Heisenbug)
Kernel \r on an \m (\l)

[FEDORA_CASPER@new-host-3 ~]$
[FEDORA_CASPER@new-host-3 ~]$ sudo cat /etc/sudoers
[sudo] password for FEDORA_CASPER:
FEDORA_CASPER is not in the sudoers file.  This incident will be reported.
[FEDORA_CASPER@new-host-3 ~]$ su root
so i went in as root and used this to add to the sudoers.

[root@new-host-3 FEDORA_CASPER]# su -c " usermod -g wheel FEDORA_CASPER"
[root@new-host-3 FEDORA_CASPER]#
[root@new-host-3 FEDORA_CASPER]#
which did nothing to the /etc/sudoers file

SO I went in as root and then added this to the /etc/sudoers file

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
but I got a warning - user alias not referenced is there something else that I have to do

[FEDORA_CASPER@new-host-3 ~]$ sudo visudo
[sudo] password for FEDORA_CASPER:
visudo: Warning: User_Alias `FEDORA_CASPER' referenced but not defined
[FEDORA_CASPER@new-host-3 ~]$
Old 05-24-2014, 08:19 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,894

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Here is a sample of a sudoers file to see how it's set up.
Old 05-24-2014, 08:41 AM   #3
Registered: Aug 2009
Posts: 349

Original Poster
Rep: Reputation: 16
thanks bigrigdriver

what is the wheel - is it a hash of some kind.

# root and users in group wheel can run anything on any machine as any user
root		ALL = (ALL) ALL
%wheel		ALL = (ALL) ALL
Old 05-24-2014, 12:08 PM   #4
LQ Guru
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,147

Rep: Reputation: Disabled
Not sure about your distro, but normally users in wheel group can su to root.
Old 05-24-2014, 03:36 PM   #5
LQ Newbie
Registered: May 2014
Distribution: Linux Mint 16 Petra
Posts: 26

Rep: Reputation: 25
You can add yourself to the wheel group by typing this. Must be root

gpasswd -a username wheel
Old 05-24-2014, 08:33 PM   #6
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,657
Blog Entries: 17

Rep: Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259Reputation: 3259
As root, you can edit the sudoers file using visudo from the command line; visudo is special editor designed to militate against error in editing sudoers. It is the canonical way for editing the sudoers file.

See man visudo for more.

This article might also help:

Last edited by frankbell; 05-24-2014 at 08:34 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Giving sudo access to a user by adding to a group lslack Linux - Server 4 11-03-2013 11:48 PM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 03:48 PM
Adding SUDO path in Solaris. manalisharmabe Solaris / OpenSolaris 1 08-23-2013 02:51 AM
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 04:11 PM
sudo is junk in ubuntu. thinking about adding a root user. fakie_flip Linux - Newbie 21 08-09-2006 03:35 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration