SEUNSHARE(8)
π seunshare(8) β like, the whole entire manual page, bestie
okay so. welcome to seunshare, a user command, section 8. yes i'm giving you the whole thing. no cap. π
β¨ NAME β¨
seunshare β run cmd with an alternate homedir, tmpdir and/or SELinux context π¦
πΈ SYNOPSIS πΈ
seunshare [ -v ] [ -C ] [ -k ] [ -t tmpdir ] [ -h homedir ] [ -Z context
] -- executable [args]
π DESCRIPTION π
So here's the tea β β you run that executable inside the context you picked, with a custom home directory and a custom /tmp directory. The way it works is genuinely iconic: seunshare unshares from the default namespace first, then mounts the homedir and tmpdir you specified over the default homedir and /tmp. And finally β the main character moment β it tells the kernel to execute the application under the SELinux context you gave it. periodt. π
-hhomedir β alternate homedir that the application is gonna use. bestie, the homedir must be owned by the user. no exceptions, we don't make the rules π-ttmpdir β use an alternate temporary directory and mount it on/tmp. same deal: tmpdir must be owned by the user. β¨-rrunuserdir β use an alternate temporary directory and mount it onXDG_RUNTIME_DIR(that's/run/user/$UIDfor the uninitiated π«Ά). and yeah, runuserdir must be owned by the user too. the ownership checks are non-negotiable, i fear.-C,--capabilitiesβ lets apps executed inside the namespace actually use capabilities. the default? no capabilities. so if you want them, you gotta ask. π-k,--killβ kills all processes with a matching MCS level. it's giving cleanup, it's giving closure π-Zcontext β use an alternate SELinux context while running the executable. slay. π₯-vβ verbose output, so you can see everything happening in real time. we love a transparent queen π
π EXAMPLE π
run bash with a temporary /home and /tmp directory, like so:
# USERHOMEDIR=`mktemp -d /tmp/home.XXXXXX`; USERTEMPDIR=`mktemp -d /tmp/temp.XXXXXX`
# seunshare -v -h ${USERHOMEDIR} -t ${USERTEMPDIR} -- /bin/bash
π¦ SEE ALSO π¦
runcon(1), sandbox(8), selinux(8)
go read those too, i'm literally obsessed with cross-referencing π«Ά
π AUTHOR π
this manual page was written by Dan Walsh <dwalsh@redhat.com> and Thomas Liu <tliu@fedoraproject.org> β legends, honestly. π
and that's a wrap on seunshare, page seunshare, from way back in May 2010 (yes, it's been serving looks since 2010 π). bye bestie, go unshare something responsibly! πβ¨
π¦ where this page comes from
- centos-stream 10: policycoreutils-sandbox 3.11-1.el10 Β· GPL-2.0-or-later
- centos-stream 9: policycoreutils-sandbox 3.6-9.el9 Β· GPL-2.0-or-later
- fedora 43: policycoreutils-sandbox 3.9-5.fc43 Β· GPL-2.0-or-later
- fedora 43: policycoreutils-sandbox 3.9-7.fc43 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-sandbox 3.10-1.fc44 Β· GPL-2.0-or-later
- fedora 44: policycoreutils-sandbox 3.11-2.fc44 Β· GPL-2.0-or-later
- nixos 26.05: selinux-sandbox 3.10
- nixpkgs unstable: selinux-sandbox 3.11
- opensuse-leap 16.0: policycoreutils-sandbox 3.8.1-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-sandbox 3.8.1-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-sandbox 3.8.1-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: policycoreutils-sandbox 3.8.1-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: selinux-sandbox 3.8.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: selinux-sandbox 3.8.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: selinux-sandbox 3.8.1-bp160.1.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: selinux-sandbox 3.8.1-bp160.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms