how to issue SUDO as root with NOPASSWD

forums@cozy

Registered
hello people,

I've been trying to setup sudo to run as root with no password in Panther. However, I appear to be doing something wrong despite reading the man page, using hints posted on other sites and copying the sudoer format from various Linux installations. No matter what I do, sudo always requires a password! (of course - once a password has been offered the sudo feature remains password free for a period of minutes - great, but that sucks for running commands in the crontab)

Examples I have used:

a) myuser ALL= NOPASSWD: ALL
b) myuser ALL=(root) NOPASSWD: ALL
c) myuser ALL=(ALL) NOPASSWD: ALL

Does anyone know why this is happening?

cheers :D
 
It's happening because that's how it's built to work. root is disabled by default though. It's not a good idea to run without any password.
 
Gee - Thanks Captain Code. That must be the most helpful reply to any forum post I have ever submitted. You either didn't read the entire post or didn't understand it. For the benefit of others in the same predicament, here is what you should have written:

The first default user under Panther usually becomes part of the %admin group . If you try to setup that user within the /private/etc/sudoers file before the %admin statement, your settings will be overwritten. Therefore - in answer to my own question, the answer is: either modify the %admin group to use NOPASSWD, setup the user after the %admin statement or setup a new non-priviledged user to work as.

Cheers,
 
Cozy take a deep breath and maybe go for a walk. OK now you feel better.

What Cptn. Code was trying to hint at is that sudo is not the right tool for what you are doing. You certainly should not be running it from cron. So before you neuter the security on your box what if you tell us what you are really tying to accomplish and us Unix geezers might be able to offer some hints.

The thing to keep in mind is that sudo is intended as a tool for a user to temporarily elevate their privileges to access a generally limited set of programs while maintaining an audit trail. Remember it is not just su spelled differently, they are different tools for different needs.
 
yep - deep breath taken.

However, I wasn't asking if I was using the right tool. I was asking why entries in the sudoers file didn't seem to be working. Luckily I figured it out myself.

Thanks for the mothering nonetheless.

:p
 
I was trying to say that what you want to do isn't such a good idea, but if you want to go ahead and do it then be warned.
 
Back
Top