Forcing Scripts to Run as root
May 28, 2011, 02:03 (0 Talkback[s])
WEBINAR: On-demand Event
Replace Oracle with the NoSQL Engagement Database: Why and how leading companies are making the switch REGISTER >
[ Thanks to Andrew
Weber for this link. ]
"A common question that is asked is, "How do you make sure only
root can run a script?". There are several ways to make this
happen. A common method is to write a test to verify the user ID.
The command that is often used for this task is id. The id command
has an option "-u" that returns the UID of the person executing it
so it is an easy solution to implement."