SEUNSHARE(8)

πŸ“¦
version 3.11 Β· 3 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’… 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. πŸ’…

  • -h homedir β€” 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 😭
  • -t tmpdir β€” use an alternate temporary directory and mount it on /tmp. same deal: tmpdir must be owned by the user. ✨
  • -r runuserdir β€” use an alternate temporary directory and mount it on XDG_RUNTIME_DIR (that's /run/user/$UID for 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 πŸ’€
  • -Z context β€” 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! πŸŽ€βœ¨