LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-15-2012, 05:25 AM   #1
briandc
Member
 
Registered: Sep 2011
Location: Italy
Distribution: KXStudio, Bodhi Linux, AntiX, Mint
Posts: 91

Rep: Reputation: Disabled
Changing sudoers file with Visudo


Hello,
Can someone please explain to me in simple terms how I can add my user to my sudoers file (which only contains root) ?

Much thanks.

brian
 
Old 04-15-2012, 05:30 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
The simplest way would be to add your username to the "wheel" group. Then edit the sudoers file:
Code:
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
The comment tells you what to do.

When you are done doing this, you will need to reboot after changing group memberships & modifying sudo so that the kernel keeps the correct list of groups you are a member off.
 
Old 04-15-2012, 05:38 AM   #3
rokytnji
LQ 5k Club
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17 , ChromeOS
Posts: 5,206
Blog Entries: 20

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
If talking about AntiX

http://antix.mepis.org/index.php?tit...ntiX_Ratpoison

Edit: lets try this link again

Link

That's better.

Last edited by rokytnji; 04-15-2012 at 05:41 AM.
 
Old 04-15-2012, 06:13 AM   #4
briandc
Member
 
Registered: Sep 2011
Location: Italy
Distribution: KXStudio, Bodhi Linux, AntiX, Mint
Posts: 91

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jschiwal View Post
The simplest way would be to add your username to the "wheel" group. Then edit the sudoers file:
Code:
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
The comment tells you what to do.

When you are done doing this, you will need to reboot after changing group memberships & modifying sudo so that the kernel keeps the correct list of groups you are a member off.
Found it! Now I'll reboot..

brian

Last edited by briandc; 04-15-2012 at 06:15 AM.
 
Old 04-15-2012, 06:23 AM   #5
briandc
Member
 
Registered: Sep 2011
Location: Italy
Distribution: KXStudio, Bodhi Linux, AntiX, Mint
Posts: 91

Original Poster
Rep: Reputation: Disabled
Everything works fine... just that it seems I'm running root as normal user, since my password isn't required to do make changes. I've gone from no rights to total rights! Can I change that so that I need to put my password?

The reason is that, since "wheel" doesn't exist, the file contains
%sudo ALL=NOPASSWD: ALL

Should I create a wheel group?

brian

Last edited by briandc; 04-15-2012 at 06:31 AM.
 
Old 04-15-2012, 08:51 AM   #6
rokytnji
LQ 5k Club
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 17 , ChromeOS
Posts: 5,206
Blog Entries: 20

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
Quote:
%sudo ALL=NOPASSWD: ALL
should be

Code:
%sudo (your username)=NOPASSWD: ALL
It was also in the link I posted. You can also limit other user name privileges for only shutdown and reboot.

Last edited by rokytnji; 04-15-2012 at 08:54 AM.
 
1 members found this post helpful.
Old 04-15-2012, 09:24 AM   #7
briandc
Member
 
Registered: Sep 2011
Location: Italy
Distribution: KXStudio, Bodhi Linux, AntiX, Mint
Posts: 91

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rokytnji View Post
should be

Code:
%sudo (your username)=NOPASSWD: ALL
It was also in the link I posted. You can also limit other user name privileges for only shutdown and reboot.
Got it!
Thanks, rokytnji.

brian
 
  


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
How to edit "sudoers" file using visudo maniac matt Linux - Newbie 11 06-22-2013 09:38 AM
sudoers file and visudo mattydee Slackware 16 12-23-2007 09:50 AM
Help with sudoers file (visudo) jasongunnisthedevil Linux - Security 1 01-21-2006 12:38 AM
visudo lets me edit sudoers but not save ver 3.3.1 suguru MEPIS 4 12-19-2005 07:23 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:41 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