Click to See Complete Forum and Search --> : how to make a specific program run as root ?


anton
09-20-2001, 04:06 PM
Hello,


well, subj again ;)... should I write a simple scipt like :
su
eroaster

will this work ?

is there some nicer/better way ?

thx :)

element-x
09-20-2001, 04:58 PM
You could set the setUID bit, but I wouldn't suggest it. The less suid binaries that you have, the better.

If you're still adamant about doing this, I think the command would be like

chmod +s /usr/bin/binary_file

(of course, substitute the path with the file that you want to set the suid bit on.)

anton
09-20-2001, 05:05 PM
and what this will do ? .... will ask for a password ? or won't run at all with normal user?

thx :)

element-x
09-20-2001, 07:33 PM
It will allow you to run a binary which normally requires root to be excuted, to be executed by a normal, un-privileged user.

And, in fact isn't the greatest way of doing it, but it seems you're quite adamant about doing this (just by the double posting of your question.)

Another option would be to use SUDO, if you don't have it installed either check your system packages (on install CD) or goto freshmeat.net and search for it. This would be the more sensible and definately more secure option.

anton
09-20-2001, 07:56 PM
JAdrock : thx :) I'll try ...

p.s. where did I double post ? :)

element-x
09-20-2001, 11:11 PM
http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=1&t=023120


I don't believe they're exactly the same, but rephrased and revised.

anton
09-20-2001, 11:15 PM
no, in that post I was just wondering why is it so :)

by the way , is there any other way to do subj , so it will LOGIN as root and run that program ? ... so it will ask a password from me for root ?


thx :)