Re: Magneto Optical Drives for SGI Workstations

George Sukenick (g-sukenick@ski.mskcc.org)
Fri, 28 Mar 1997 11:34:41 -0400

Since I see this come up every so often, I thought
I'd post to AMMRL.

One method to allow users execute a command ordinarily
allowed only as root would be to write a two line program
that accesses the command. The program should be owned
by root with chmod permission 6755. The "6" in the
permission gives the program the same privilege as the
owner/group of the program...if root owns the program, when
executed by anyone, the program acts almost as if it was executed
by root.

Here is my program for re-booting the system.
Note that you may substitute most any UNIX command in the
quotes, such as that for mounting, unmounting, formatting etc.

I'm not sure what happens if an interactive command were executed
in this manner, but it's probably best to give minimal
root exposure and use only non-interactive commands.

Use your favorite editor to create a file with:

main(){
system("init 6");
}

Then compile, rename the a.out file, change owner to
root, change permission to 6755 and move the file
to a public directory (don't forget to test the
program before making it public!)....and be very very
careful what command you put in those quotes....:-)

This does not work for UNIX scripts, thus the need for the
compilation.