Renounce root privileges?

I have a program that launches a bunch of tasks with root privileges at startup. After that, he needs to refuse another user. How can I do that?

And just wondering, is it possible to restart root without restarting the program?

+3
source share
1 answer

The short answer is to use the function setuid().

You cannot re-gain root privileges after switching to a non-root user.

+3
source

Source: https://habr.com/ru/post/1758645/


All Articles