Help answer threads with 0 replies.
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 01-10-2009, 12:01 AM   #1
LQ Newbie
Registered: Jan 2009
Location: florida U.S.A
Distribution: gentoo
Posts: 4

Rep: Reputation: 0
Question need HELP with editing sudoers file

Every time i use the su apt-get command i get the message " (username) is not in the sudoers file. My question is, how do i edit the sudoers file?
Old 01-10-2009, 12:07 AM   #2
Registered: Aug 2008
Location: India
Distribution: Fedora, RedHat
Posts: 101

Rep: Reputation: 17
Just run the

# visudo
(as root of course...) and you'll have your sudoers file opened with default editor (vi) and go the the END of the file (ctrl + g) and you'll see all examples. Following will give you all rights

username           ALL=(ALL)
FYI, same is written for root there, you'll find easy to config that file...
Old 01-10-2009, 03:23 AM   #3
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
I would change that to
username  ALL=PASSWD:ALL
If you dislike vim you can try with
export EDITOR=nano && visudo
Old 01-10-2009, 03:38 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Check if your debian system has the "wheel" group. If so add yourself to the "wheel" group and then use "visudo" as root to uncomment the line near the bottom:
# Uncomment to allow people in group wheel to run all commands
# %wheel        ALL=(ALL) ALL
Delete the first two characters of the line.

I don't know if nano is acceptable for visudo. Error detection may be bypassed.

Last edited by jschiwal; 01-10-2009 at 03:39 AM.
Old 01-10-2009, 03:45 AM   #5
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Umm, where did he say debian?
If debian, from man visudo:
There is a hard-coded list of editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default variable. On Debian systems, this list defaults to /usr/bin/editor, which is meant to be a system-wide default editor chosen through the alternatives system.
Normally, visudo does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned editors list. However, if visudo is configured with the --with-enveditor flag or the env_editor Default variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR. Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR. Despite this potential risk, sudo on Debian is compiled with the --with-enveditor flag.


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
sudoers config file crashed while editing and can no longer be written to CrinkElite Linux - Software 2 03-16-2008 01:02 AM
Editing Sudoers File... aapanju Linux - Newbie 7 03-06-2008 10:10 PM
Editing sudoers (shows as new file in nano) rushinblue Linux - Newbie 2 11-06-2007 02:17 PM
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
Help Editing Sudoers File Rubicone Linux - Newbie 2 05-03-2002 02:50 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:43 PM.

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