Operating System - HP-UX
1845834 Members
3576 Online
110250 Solutions
New Discussion

Re: Replace command with my script

 
Rene Mendez_4
Super Advisor

Replace command with my script

HI

I need replace command kill with other script.

New script kill must generate kill.log with information of user,date.

Regards
Rene
4 REPLIES 4
RAC_1
Honored Contributor

Re: Replace command with my script

while you can use a script to do this, a better way exists for this.

What you have to do is convert your system to trusted mode and start auditing. And now set up auditing for kill and raise system calls.

Anil
There is no substitute to HARDWORK
Rene Mendez_4
Super Advisor

Re: Replace command with my script

thanks but I do not have permission for the configuration and we must form it
A. Clay Stephenson
Acclaimed Contributor

Re: Replace command with my script

One of the first steps that you must take is to create an alias for kill because kill is a shell built-in. You must make sure that all users get this alias definition.

This whole exercise seems a bit wrong-headed in that ordinary users should only be able to kill (more properly signal) their own processes; if you have root users who are killing processes then you have a bigger problem. If you must do it, a simple shell wrapper for /usr/bin/kill is straightforward but any super-user can easily hide their tracks and if they are not super-user's then they can't kill the process anyway --- unless they own it.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: Replace command with my script

Hi Rene,

In addition to the responses above, it is not a good idea to replace the commands with scripts. A user can always find the original command (for ex., after writing the wrapper script, you may move the command 'kill' as 'bla' and specify it in your script) and use it. Also, when you install patches later, they can put the new version of commands back in place.

This is only possible if you use tools like eTrust access control, powerbroker etc.,But they may be too much for just your requirement.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try