I want to check if a specific process is running in privileged mode. If a process is running is privileged mode, necessarily the user running it is going to be root?

I've noticed that when I use sudo, the process created will be associated to root instead of the current user, like in the output of the following command (it outputs "root"):

sudo sleep 10 & ps aux | grep sl[e]ep | cut -d' ' -f1

I know how to check if a process is being run by root, but I'm not sure if a process runs in privileged mode if, and only if, the user running it is root.

  • 1
    In modern Linux, technically the superuser privileges are broken up into capabilities; however, in practice, it often still behaves like the old "superuser-or-nothing" setup. Given that complexity, however, it's probably better to check specifically whether a process can do one specific thing you want to know about. – Tom Hunt Oct 19 '15 at 22:17
  • No matter what username (` root```` I` – waltinator Oct 20 '15 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.