My goal: I have a bash script that needs to be run as a root user in a way that wouldn't be killable by a regular user--me. However, as a regular user, I need to be able to start the script (there might be cases where this unkillable script shouldn't be executed).
Is there a way to achieve it?
I imagine the following workflow: I log in to my regular account, execute the bash script, which then starts a specific program. This program becomes unkillable by me because it was started from an administrator account.
The way I do it now: I log in to my regular user, do su admin
and insert a complicated password, and run the program in unattached way (i.e. with &
). I then close the terminal and continue with the opened program and go on with my day.
What I tried: grant my user rights to execute the script created by the admin, but this of course makes me able to kill the script afterwards, since I own that process. I would like that the process would be owned by another user..