Ubuntu This forum is for the discussion of Ubuntu Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-09-2008, 05:29 AM
|
#1
|
Member
Registered: Sep 2005
Posts: 861
Rep:
|
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?
|
|
|
01-09-2008, 06:40 AM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,285
|
I did this on one of my machines - works fine as far as I'm concerned.
What did you setup ???.
|
|
|
01-09-2008, 06:45 PM
|
#3
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
How did you edit the sudoers file? Did you use visudo?
|
|
|
01-10-2008, 06:57 AM
|
#4
|
Member
Registered: Sep 2005
Posts: 861
Original Poster
Rep:
|
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.
|
|
|
01-10-2008, 10:23 AM
|
#5
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
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.
|
|
|
01-11-2008, 05:22 AM
|
#6
|
Member
Registered: Sep 2005
Posts: 861
Original Poster
Rep:
|
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.
|
|
|
01-11-2008, 10:17 AM
|
#7
|
LQ Newbie
Registered: Jan 2008
Location: West Sumatra, Indonesia
Distribution: Ubuntu
Posts: 5
Rep:
|
Quote:
Originally Posted by depam
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..
|
|
|
01-11-2008, 11:20 AM
|
#8
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
Quote:
Originally Posted by depam
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.
|
|
|
01-11-2008, 11:23 AM
|
#9
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
Quote:
Originally Posted by al13ncr33d
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.
|
|
|
01-11-2008, 12:20 PM
|
#10
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
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.
|
|
|
01-11-2008, 02:14 PM
|
#11
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
Quote:
Originally Posted by PTrenholme
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.
|
|
|
01-12-2008, 02:10 PM
|
#12
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Quote:
Originally Posted by hex1a4
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.
|
|
|
01-12-2008, 03:58 PM
|
#13
|
Member
Registered: Dec 2007
Location: ON CA
Distribution: Xubuntu 8.04; Xubuntu 6.06.2
Posts: 64
Rep:
|
Quote:
Originally Posted by PTrenholme
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.
|
|
|
All times are GMT -5. The time now is 03:32 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|