LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 05-24-2014, 09:02 AM   #1
casperdaghost
Member
 
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

Code:
[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
Password:
so i went in as root and used this to add to the sudoers.

Code:
[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

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

Code:
[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, 09:19 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

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

Original Poster
Rep: Reputation: 16
thanks bigrigdriver

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

Code:
# 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, 01:08 PM   #4
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
Not sure about your distro, but normally users in wheel group can su to root.
 
Old 05-24-2014, 04:36 PM   #5
nyc_rr
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, 09:33 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,352
Blog Entries: 12

Rep: Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731Reputation: 2731
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: https://www.digitalocean.com/communi...ntu-and-centos

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


Reply


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-04-2013 12:48 AM
Question about the sudo command, specifically how to have sudo act as if user is root slacker_ Linux - Newbie 17 09-22-2013 04:48 PM
Adding SUDO path in Solaris. manalisharmabe Solaris / OpenSolaris 1 08-23-2013 03:51 AM
[SOLVED] "sudo: Can't mkdir /var/run/sudo/%user%: File exists" CNBarnes Linux - Server 7 01-10-2011 05:11 PM
sudo is junk in ubuntu. thinking about adding a root user. fakie_flip Linux - Newbie 21 08-09-2006 04:35 PM


All times are GMT -5. The time now is 04:18 AM.

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