2025-03-14 21:59:59 -06:00
|
|
|
# chroot
|
|
|
|
|
|
|
|
|
|
> Run command or interactive shell with special root directory.
|
|
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/chroot-invocation.html>.
|
|
|
|
|
|
|
|
|
|
- Run command as new root directory:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chroot {{path/to/new/root}} {{command}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Use a specific user and group:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`sudo chroot --userspec {{username_or_id:group_name_or_id}}`
|