LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04: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, 04:30 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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, 04:38 AM   #3
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,110
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
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 04:41 AM.
 
Old 04-15-2012, 05: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 05:15 AM.
 
Old 04-15-2012, 05: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 05:31 AM.
 
Old 04-15-2012, 07:51 AM   #6
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,110
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
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 07:54 AM.
 
1 members found this post helpful.
Old 04-15-2012, 08: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



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 08:38 AM
sudoers file and visudo mattydee Slackware 16 12-23-2007 08:50 AM
Help with sudoers file (visudo) jasongunnisthedevil Linux - Security 1 01-20-2006 11:38 PM
visudo lets me edit sudoers but not save ver 3.3.1 suguru MEPIS 4 12-19-2005 06: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 05:03 PM

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

All times are GMT -5. The time now is 07:50 PM.

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
Open Source Consulting | Domain Registration