I am adding information to @ilkkachu answer.
It seems that the capabilities of the process determines if the user is privileged or not.
For example, let's remove all the capabilities except one (cap_checkpoint_restore
):
capsh --drop=cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,cap_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_resource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_setfcap,cap_mac_override,cap_mac_admin,cap_syslog,cap_wake_alarm,cap_block_suspend,cap_audit_read,cap_perfmon,cap_bpf -- -c 'sleep 10000'
We can see that this user has only one capability cap_checkpoint_restore
, even when the user is root
:
# ps aux | grep sleep
root 2309662 0.0 0.0 5768 1008 pts/5 S+ 07:21 0:00 sleep 10000
# cat /proc/2309662/status | grep Cap
CapInh: 0000000000000000
CapPrm: 0000010000000000
CapEff: 0000010000000000
CapBnd: 0000010000000000
CapAmb: 0000000000000000
# capsh --decode=0000010000000000
0x0000010000000000=cap_checkpoint_restore