LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Ubuntu 7.10 sudoers not working (https://www.linuxquestions.org/questions/ubuntu-63/ubuntu-7-10-sudoers-not-working-612211/)

depam 01-09-2008 04:29 AM

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?

syg00 01-09-2008 05:40 AM

I did this on one of my machines - works fine as far as I'm concerned.
What did you setup ???.

hex1a4 01-09-2008 05:45 PM

How did you edit the sudoers file? Did you use visudo?

depam 01-10-2008 05:57 AM

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.

hex1a4 01-10-2008 09:23 AM

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.

depam 01-11-2008 04:22 AM

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.

al13ncr33d 01-11-2008 09:17 AM

Quote:

Originally Posted by depam (Post 3017663)
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..

hex1a4 01-11-2008 10:20 AM

Quote:

Originally Posted by depam (Post 3018815)
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.

hex1a4 01-11-2008 10:23 AM

Quote:

Originally Posted by al13ncr33d (Post 3019019)
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.

PTrenholme 01-11-2008 11:20 AM

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.

hex1a4 01-11-2008 01:14 PM

Quote:

Originally Posted by PTrenholme (Post 3019164)
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.

PTrenholme 01-12-2008 01:10 PM

Quote:

Originally Posted by hex1a4 (Post 3019274)
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.

hex1a4 01-12-2008 02:58 PM

Quote:

Originally Posted by PTrenholme (Post 3020247)
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 06:57 AM.