Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] Set UID programs


What method do people prefer when wanting a program to run as a particular
user?
Examples:
	At startup time, in init.d I might want to run a script as user
"blah"
	Or I want to run a program as user "blah" where "blah" has less
privileges than my normal user account.

(Thinks of easily broken things like X and Netscape, hehe)

Some solutions:
	su blah -c "/bin/sh myscript"
	(This will prompt for password if I am not already root and "blah"
needs a password)
	or
	# chmod u+s blah myprogram
	Then, when called, myprogram should run as user "blah", although it
probably won't work over NFS.

Which is preferable?
Are there other ways of doing it?

Regards,

Jill.
___________________________________________
Jill Rowling
Snr Design Engineer & Unix System Administrator
Electronic Engineering Department, Aristocrat Technologies Australia
3rd Floor, 77 Dunning Ave Rosebery NSW 2018
Phone:	(02) 9697-4484		Fax:	(02) 9663-1412
Email:	rowling@xxxxxxxxxx