Mikuro
Crotchety UI Nitpicker
I want to make a simple shell script that I can easily run as root WITHOUT needing to enter my password every time.
I've heard that you can set an executable file to run as its owner all the time, so if you make its owner root, you're in business. I've done this like so, following instructions I've found in several places online:
But this does not work. After a little investigation I learned that Apple does not allow this for shell scripts anymore for security reasons, but it DOES (supposedly) allow compiled applications. So I made a simple AppleScript to execute the shell script (hard-coded into the AppleScript file with the "do shell script" command), saved it as an application, and repeated the above steps.
Again, it does not work. The applet will not even load. It just flickers in the Dock for an instant and then disappears.
Am I doing something wrong, or is Leopard even more limited? (Most of the tips I've found online seem to be from 10.3 or 10.4.)
Is there any other way to accomplish this without A) typing my password every time, or B) leaving my root password exposed in the source of a script?
I've heard that you can set an executable file to run as its owner all the time, so if you make its owner root, you're in business. I've done this like so, following instructions I've found in several places online:
Code:
sudo chmod 4711 <file>
sudo chown root <file>
Again, it does not work. The applet will not even load. It just flickers in the Dock for an instant and then disappears.
Am I doing something wrong, or is Leopard even more limited? (Most of the tips I've found online seem to be from 10.3 or 10.4.)
Is there any other way to accomplish this without A) typing my password every time, or B) leaving my root password exposed in the source of a script?