2016-01-05 21:07:36 +05:30
|
|
|
# chroot
|
|
|
|
|
|
|
|
> Run command or interactive shell with special root directory.
|
2024-12-12 09:54:34 -08:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/chroot-invocation.html>.
|
2016-01-05 21:07:36 +05:30
|
|
|
|
2016-01-28 12:41:00 +01:00
|
|
|
- Run command as new root directory:
|
2016-01-05 21:07:36 +05:30
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`sudo chroot {{path/to/new/root}} {{command}}`
|
2016-01-05 21:07:36 +05:30
|
|
|
|
2024-01-24 04:22:18 -03:00
|
|
|
- Use a specific user and group:
|
2016-01-05 21:07:36 +05:30
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`sudo chroot --userspec {{username_or_id:group_name_or_id}}`
|