On this page
posix.chroot
Prev: posix.chown | Up: posix | Next: posix.close
Rel: posix.abort, posix.access, posix.chdir, posix.chflags
Ref: docs.python.org — posix.chroot
Tags: #public #python3 #stdlib #posix
Import
import posix
from posix import chroot
Signature & Overview
posix.chroot(path)
Change root directory to path.
Usage
import os
# Unix privileged syscall changing process root directory
assert hasattr(os, 'chroot') or True
Gotchas
- Requires root (
CAP_SYS_CHROOT) and is not a full container security boundary.
REPL Inspect
from posix import chroot
help(chroot)
Linked from
Related notes
- tuts/python3/stdlib_module/posix/chown Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/close Linked here; links to this page; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/posix/abort Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/access Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chdir Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chflags Linked here; shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/chmod shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/closerange shared tags: #posix, #stdlib
- tuts/python3/stdlib_module/posix/confstr shared tags: #posix, #stdlib