info > setpriv(1)

SETPRIV(1) User Commands SETPRIV(1)

📝 NAME

setpriv - run a program with different Linux privilege settings

🚀 Quick Reference

Use CaseCommandDescription
Dump current privilege statesetpriv -dShow all privilege settings (can be repeated for extra info)
Clear supplementary groupssetpriv --clear-groups <program>Remove all supplementary groups before exec
Set supplementary groupssetpriv --groups group1,group2 <program>Specify a comma-separated list of groups
Drop privileges (like su)setpriv --reuid=1000 --regid=1000 --init-groups <program>Set real UID/GID and initialize groups from passwd
Drop privileges (like daemontools)setpriv --reuid=1000 --regid=1000 --clear-groups <program>Set UID/GID and clear all supplementary groups
Set no_new_privssetpriv --no-new-privs <program>Prevent privilege escalation on exec
List all known capabilitiessetpriv --list-capsShow cap_* names and indices
Drop all inheritable capabilitiessetpriv --inh-caps=-all <program>Remove all capabilities from inheritable set
Set parent death signalsetpriv --pdeathsig SIGTERM <program>Send signal to child if parent dies

📖 SYNOPSIS

setpriv [options] program [arguments]

📝 DESCRIPTION

Sets or queries various Linux privilege settings that are inherited across execve(2).

In comparison to su(1) and runuser(1), setpriv neither uses PAM, nor does it prompt for a password. It is a simple, non-set-user-ID wrapper around execve(2), and can be used to drop privileges in the same way as setuidgid(8) from daemontools, chpst(8) from runit, or similar tools shipped by other service managers.

⚙️ OPTIONS

📝 NOTES

If applying any specified option fails, program will not be run and setpriv will return with exit status 127.

Be careful with this tool — it may have unexpected security consequences. For example, setting no_new_privs and then execing a program that is SELinux-confined (as this tool would do) may prevent the SELinux restrictions from taking effect.

📌 EXAMPLES

If you're looking for behavior similar to su(1)/runuser(1), or sudo(8) (without the -g option), try something like:

setpriv --reuid=1000 --regid=1000 --init-groups

If you want to mimic daemontools' setuid(8), try:

setpriv --reuid=1000 --regid=1000 --clear-groups

👤 AUTHORS

Andy Lutomirski <luto AT amacapital.net>

📚 SEE ALSO

runuser(1), su(1), prctl(2), capabilities(7)

🐛 REPORTING BUGS

For bug reports, use the issue tracker at https://github.com/karelzak/util-linux/issues.

📦 AVAILABILITY

The setpriv command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.

util-linux 2.37.2 2021-06-02 SETPRIV(1)

setpriv(1)
📝 NAME 🚀 Quick Reference 📖 SYNOPSIS 📝 DESCRIPTION ⚙️ OPTIONS 📝 NOTES 📌 EXAMPLES 👤 AUTHORS 📚 SEE ALSO 🐛 REPORTING BUGS 📦 AVAILABILITY

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-24 17:58 @216.73.217.23
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!