I have started some processes (window based) from user's .bashrc file. I want to prevent users from killing those processes. Is there a way to transfer the process to superuser so that a normal user cannot kill it? Or is there a way of starting some process which is owned by super user himself?
|
|
|||
|
You may built in a trap in your processes to prevent a normal kill (SIGINT). That would of course not work for a SIGKILL (-9). Such a trap would look like (bash):
To reset the trap you could use
|
|||
|
|
|
Start a command as a different user is usually done with su, sudo or by setting the setuid bit in the permissions of the executable. You do not want to have executables run as root unless they absolutely need to, as that user has all priviledges. If those processes don't need any priviledge, you can make them run as "nobody" which is the user whom we try to grant the least prviledges as possible. A user has always the right to kill its own processes (as long as it's got access to the kill system call), or said otherwise, a process of a given effective uid has always the right to send a signal to a process running as the same effective uid. |
|||
|
|
|
Depends on what exactly you're doing, but your options are:
|
|||||||||
|

sudotag. – Marco Sep 4 '12 at 18:14sudo /path/to/executableor dosudo suand then `/path/to/executable'? – mtahmed Sep 4 '12 at 18:55super userwon't be logged into the system. Its just a PC and not a computer where multiple users can login. – Juzer Ali Sep 4 '12 at 18:57