I was wondering if it was possible for a process in Linux (assuming it had root access) to change another process's UID including the RUID, SUID, and EUID, and if so, if there was a specific implementation I could do (whether that be in C++ or in a bash script, e.t.c). I'm mainly trying to stop certain recurrent processes from executing with root privileges immediately upon spawn, which they seem to upon spawning.
Thanks! My apologies if the question is unclear. If it is, I can clarify any details.