tech:chroot
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:chroot [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:chroot [2025/10/28 15:04] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| {{tag> | {{tag> | ||
| - | = Chroot Linux | + | # Chroot Linux |
| Ligne 7: | Ligne 8: | ||
| Voir : | Voir : | ||
| * https:// | * https:// | ||
| - | * [[https:// | + | * https:// |
| - | * [[https:// | + | * https:// |
| - | * [[http:// | + | * http:// |
| - | * [[https:// | + | * https:// |
| - | * [[http:// | + | * http:// |
| - | * [[http:// | + | * http:// |
| - | * [[http:// | + | * http:// |
| - | * [[https:// | + | * https:// |
| - | * [[http:// | + | * http:// |
| Chroot Infinite BusyBox with systemd | Chroot Infinite BusyBox with systemd | ||
| - | * [[http:// | + | * http:// |
| * switch_root | * switch_root | ||
| libpam-chroot: | libpam-chroot: | ||
| - | * [[https:// | + | * https:// |
| - | * [[http:// | + | * http:// |
| Voir fakeroot et consorts | Voir fakeroot et consorts | ||
| * fakeroot | * fakeroot | ||
| + | * fakeroot-ng | ||
| + | * proot | ||
| + | * become-root | ||
| * rootlesskit (Linux-native "fake root" for rootless containers) | * rootlesskit (Linux-native "fake root" for rootless containers) | ||
| + | and yet slow): | ||
| + | |||
| + | |||
| + | |||
| Voir aussi : | Voir aussi : | ||
| - | * pivot_root | + | * pivot_root |
| - | * [[https:// | + | * [Debootstrap](https:// |
| * Docker | * Docker | ||
| * bwrap | * bwrap | ||
| - | * [[https:// | + | * [Firejail](https:// |
| - | | + | * ex : '' |
| * Procenv | * Procenv | ||
| - | + | '' | |
| - | <code bash chrootont.sh> | + | ~~~bash |
| CHROOTDIR=/ | CHROOTDIR=/ | ||
| Ligne 84: | Ligne 93: | ||
| exelist=' | exelist=' | ||
| - | </ | + | ~~~ |
| - | == Exemple avec bash | ||
| - | < | + | |
| + | ## Exemple avec bash | ||
| + | |||
| + | ~~~bash | ||
| ldd / | ldd / | ||
| mkdir ${CHROOTDIR}/ | mkdir ${CHROOTDIR}/ | ||
| Ligne 118: | Ligne 129: | ||
| #cp -a / | #cp -a / | ||
| - | </ | + | ~~~ |
| Pour top, atop | Pour top, atop | ||
| - | <code -> | + | ~~~ |
| ' | ' | ||
| - | </ | + | ~~~ |
| - | < | + | ~~~bash |
| cp -a / | cp -a / | ||
| Ligne 150: | Ligne 161: | ||
| #Pour les script init (services) | #Pour les script init (services) | ||
| cp -a /lib/lsb / | cp -a /lib/lsb / | ||
| - | </ | + | ~~~ |
| - | Truc | + | Truc ? |
| - | <code - /etc/passwd> | + | |
| + | '' | ||
| + | ~~~ | ||
| chroot: | chroot: | ||
| - | </ | + | ~~~ |
| - | <code bash / | + | '' |
| + | ~~~bash | ||
| #! /bin/bash | #! /bin/bash | ||
| Ligne 163: | Ligne 177: | ||
| #sudo / | #sudo / | ||
| sudo / | sudo / | ||
| - | </ | + | ~~~ |
| - | [[http:// | + | |
| - | <code -> | + | http:// |
| + | |||
| + | ~~~ | ||
| chroot ALL=(root) NOPASSWD: / | chroot ALL=(root) NOPASSWD: / | ||
| - | </ | + | ~~~ |
| **ATTENTION** Grosse faille de sécurité que je n' | **ATTENTION** Grosse faille de sécurité que je n' | ||
| Ligne 176: | Ligne 191: | ||
| Dans le chroot | Dans le chroot | ||
| - | < | + | ~~~bash |
| /sbin/getty 38400 tty8 | /sbin/getty 38400 tty8 | ||
| - | </ | + | ~~~ |
| - | < | + | ~~~bash |
| umount ${CHROOTDIR}/ | umount ${CHROOTDIR}/ | ||
| umount ${CHROOTDIR} | umount ${CHROOTDIR} | ||
| Ligne 189: | Ligne 204: | ||
| umount /chroot/* | umount /chroot/* | ||
| umount /chroot/* | umount /chroot/* | ||
| - | </ | + | ~~~ |
| - | === Comment savoir si je suis dans un chroot ? | + | ### Comment savoir si je suis dans un chroot ? |
| Les numeros d' | Les numeros d' | ||
| - | < | + | ~~~bash |
| ls -id / | ls -id / | ||
| - | </ | + | ~~~ |
| - | Voir [[http:// | + | Voir http:// |
| - | == Firejail | + | ## Firejail |
| Voir : https:// | Voir : https:// | ||
| - | < | + | ~~~bash |
| firefail --seccomp --debug firefox | firefail --seccomp --debug firefox | ||
| - | </ | + | ~~~ |
| - | == Mount kernel virtual file systems | + | ## Mount kernel virtual file systems |
| Source : https:// | Source : https:// | ||
| - | <code bash sysfs.sh> | + | '' |
| + | ~~~bash | ||
| #!/bin/sh | #!/bin/sh | ||
| # | # | ||
| Ligne 253: | Ligne 269: | ||
| fi | fi | ||
| - | </code> | + | ~~~ |
| + | |||
| + | |||
| + | |||
| + | ## Pb /etc/ | ||
| + | |||
| + | ~~~ | ||
| + | -bash: / | ||
| + | -bash: / | ||
| + | -bash: / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | ~~~bash | ||
| + | chroot --userspec=nobody | ||
| + | ~~~ | ||
tech/chroot.1742825205.txt.gz · Dernière modification : de 127.0.0.1
