help with user permission

hi everyone.
i�ve been burning my head for a week now with this problem and i couldn�t find a solution. i�ve been looking for an answer in this forum but nothing either. so i decided to ask.
the thing is, i want to create a users with permission to kill just a group of users. i know how to write the script and everything, but my problem is that that user has no permission to kill other users. i understand that only a user with UID=0 can kill another user. i dont want to grant this particular user with root privileges, since that would be stupid.
the "sudo" could help me, but its not installed on my server. can anyone find another way to do it?
im working on a "SunOS 5.9 Generic_118558-10 sun4u sparc SUNW,Sun-Fire-V440"

thanks a lot people.

luc

Download sudo from sunfreeware.com - that is the best tool for this IMHO. You could probably do a similar thing with RBAC, but sudo would be easier for this.

Cheers
ZB

hi. thanks for answering. i leave that option to the last, since probably my boss wont like it.
could anyone think of another way around it?
thanks again.

I see 2 options to do this.

Option 1:

Create a script owned by root and with the suid bit on it.
That way any used that can access the script is temporary granted root privileges.

However within that script you need to do a lot of checking to make sure that that it records who requested to kill a program/script of another user, and that the program/script requested to be killed is owned by a user who's programs/scripts can be killed by the requesting user.

Option 2:
Create a script which only stores requests into a file.

Additionally create a "root" cron job which reads the file with requests.

Again you will have to do a lot of checking if the requestor is allowed to kill those programs/scripts.

But, if I would be your boss, I would be even less happy about either of these 2 implementations. It opens all kind of possibilities for users to gain root access to your system. So you need to know exactly what you are doing.

I would stick with the sudo command

Most systems don't honor setuid/setgid on scripts. My Linux system at home doesn't, and I don't believe HP-UX or AIX do either.

However, Solaris does honor setuid scripts. A setuid script will open an unclosable security hole on most systems. Solaris has the fd file system and uses it to close that particular hole.

I too think that sudo is right way to go here; so I have been reluctant to mention another option. But now that I'm here... Let's say that we have three users whose processes need to be killed:
moe (uid=1025)
larry (uid=1026)
curly (uid=1027)
And we want shemp (uid=1028) to be able to kill processes owned only by moe, larry, and curly. We create a group called "killers" with a gid of, say, 1500; and we make shemp a member of that group. Now, we

mkdir /usr/local/killcmds
for user in moe larry curly ; do
       cp /usr/bin/kill /usr/local/killcmds/kill${user}
       chown $user /usr/local/killcmds/kill${user} 
       chgrp killers /usr/local/killcmds/kill${user}
       chmod 4050 /usr/local/killcmds/kill${user}
done

Now /usr/local/killcmds has a private kill command for each killable user. It is setuid to the target and it can be executed only by members of the killers group. These kill commands are enough, but I would also develop a script as a front end that invokes the correct kill command. I have not tested this, but I believe that it will work.

well guys, what can i say? thanks a lot to everyone... you gave me a lot of tools to work with.... now, when i have the time, ill get into it, to see what comes out, and i let you all know.
probably the easiest way is to use sudo, but what my boss wont like is the fact that i downloaded something from the outside of our network... i dont know how can i put it for you guys to understand how short his mind is... but that doesnt have anything to do with this forum...
i thank you all again

luc