2016-01-05 15:37:36 +00:00
|
|
|
# chroot
|
|
|
|
|
|
|
|
> Run command or interactive shell with special root directory.
|
2021-04-01 16:54:26 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/chroot>.
|
2016-01-05 15:37:36 +00:00
|
|
|
|
2016-01-28 11:41:00 +00:00
|
|
|
- Run command as new root directory:
|
2016-01-05 15:37:36 +00:00
|
|
|
|
2020-10-28 17:19:43 +00:00
|
|
|
`chroot {{path/to/new/root}} {{command}}`
|
2016-01-05 15:37:36 +00:00
|
|
|
|
2024-01-24 07:22:18 +00:00
|
|
|
- Use a specific user and group:
|
2016-01-05 15:37:36 +00:00
|
|
|
|
2024-01-24 07:22:18 +00:00
|
|
|
`chroot --userspec={{username_or_id:group_name_or_id}}`
|