LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-09-2008, 05:29 AM   #1
depam
Member
 
Registered: Sep 2005
Posts: 861

Rep: Reputation: 30
Ubuntu 7.10 sudoers not working


Hi,

Is there an issue with Ubuntu 7.10? I am having problems with the sudoer. After I put in my username, I am still prompted for my password eventhough I already put in "nopasswd". Any help?
 
Old 01-09-2008, 06:40 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285

Rep: Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165Reputation: 4165
I did this on one of my machines - works fine as far as I'm concerned.
What did you setup ???.
 
Old 01-09-2008, 06:45 PM   #3
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
How did you edit the sudoers file? Did you use visudo?
 
Old 01-10-2008, 06:57 AM   #4
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
I added this line

myusername ALL=(ALL)NOPASSWD:ALL

Anything I'm missing? I am still prompted for my password each time I needed to access administrative commands.
 
Old 01-10-2008, 10:23 AM   #5
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
Yes but how did you add it? Did you just edit the sudoers file, or use visudo? visudo is Ubuntu's method for editing sudoers. Just run visudo on the command line. man visudo for details.

EDIT: Where in sudoers did you add this line? If there is a line in sudoers that contradicts another, the latter one is used. For example, if you have Ubuntu's default entry (%admin ALL=(ALL) ALL
) after your own it will override it and everything else above it. Set NOPASSWD for yourself at the end of the file and it should work.

Last edited by hex1a4; 01-10-2008 at 10:42 AM.
 
Old 01-11-2008, 05:22 AM   #6
depam
Member
 
Registered: Sep 2005
Posts: 861

Original Poster
Rep: Reputation: 30
I just used the vi. This works from the previous Ubuntu that I've used 6.06 prior. I will try again later using visudo and let you know. Thanks a lot.
 
Old 01-11-2008, 10:17 AM   #7
al13ncr33d
LQ Newbie
 
Registered: Jan 2008
Location: West Sumatra, Indonesia
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by depam View Post
I added this line

myusername ALL=(ALL)NOPASSWD:ALL

Anything I'm missing? I am still prompted for my password each time I needed to access administrative commands.
yes, that's right... better use visudo
did you wrote the line like that?
i think you missed to press [TAB] key between word (ALL) and NOPASSWD.
hope this might help..
 
Old 01-11-2008, 11:20 AM   #8
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by depam View Post
I just used the vi. This works from the previous Ubuntu that I've used 6.06 prior. I will try again later using visudo and let you know. Thanks a lot.
Be sure to place your entry setting the NOPASSWD option at the end of the file.
 
Old 01-11-2008, 11:23 AM   #9
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by al13ncr33d View Post
i think you missed to press [TAB] key between word (ALL) and NOPASSWD.
hope this might help..
Spacing isn't important in sudoers, though if you have many entries, good formatting will make it more readable and allow for more efficient debugging.
 
Old 01-11-2008, 12:20 PM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
And, of course, using nopasswd will open you system for use by any malicious web site you visit.

Why not just set "root" so you can do a su - when you need to mess around at the system level? Giving a normal user unrestricted access to administrative commands is what's known in the trade a "Really Bad Idea". That is, of course, why Microsoft does it by default.
 
Old 01-11-2008, 02:14 PM   #11
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by PTrenholme View Post
Why not just set "root" so you can do a su - when you need to mess around at the system level?
su isn't that good a method for system administration. sudo -s is much better as it preserves much of the environment, including X cookies so one can ececute X applications. And of course sudo doesn't need to be prepended to every command.
 
Old 01-12-2008, 02:10 PM   #12
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by hex1a4 View Post
su isn't that good a method for system administration. sudo -s is much better as it preserves much of the environment, including X cookies so one can ececute X applications. And of course sudo doesn't need to be prepended to every command.
Perhaps, but X applications should, I believe, be avoided for most administrative application. For example, using a browser whist holding root privileges is, almost always, an unnecessary hole in your security.
 
Old 01-12-2008, 03:58 PM   #13
hex1a4
Member
 
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64

Rep: Reputation: 15
Quote:
Originally Posted by PTrenholme View Post
Perhaps, but X applications should, I believe, be avoided for most administrative application.
Obviously one shouldn't run something like a browser with root priviledges, but there are plenty of graphical administrative and related applications sometimes requiring to be run with root priviledges, and running those using gksudo can be just as annoying as prepending sudo to every command. Especially if one leaves the computer until the password expires.
 
  


Reply

Tags
sudo, sudoers, visudo


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
Ubuntu Feisty - Sound was working, but mysteriously stops working after reboot. woodsy934 Linux - Software 7 07-04-2011 07:39 PM
sudo not working, sudoers edited DIGITAL39 Linux - Newbie 2 12-18-2006 07:59 AM
sudoers texerasmo Linux - General 3 08-04-2006 10:57 AM
ATI 3D working in Ubuntu 6.06! How I got it working. steely Linux - Hardware 1 06-04-2006 12:59 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 - Distributions > Ubuntu

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