4 ms·
A couple important points which are missing from the article: 1. This requires a pretty complete system environment to be set up in the /chroot directory: a sh
by agwa 14y ago
A couple important points which are missing from the article:
1. This requires a pretty complete system environment to be set up in the /chroot directory: a shell, /etc/passwd, su, and all the libraries needed to make the program you're running work. In my experience this is the hard part.
2. chroot only isolates filesystem access but an untrusted executable might make use of your networking, for example. (Furthermore, if you're not careful an unprivileged user can become root inside the jail, and root can trivially escape chroot jails.)
Edit: I suppose the article is really about command composition and not chroot jails, but I think that a better example wouldn't involve a lot of prerequisite work.
- pkrumins 14y agoGood point about the security. I removed that sentence and just replaced it how this is a beautiful way to combine commands!
- simcop2387 14y agoIf you're alright with linux and can run the program on a debian derived distro, it's very easy to do these days with debootstrap. I've setup multiple jails on my computer for various software that doesn't play nicely with a rolling release distro all the time (coughskypecough). [1] http://wiki.debian.org/Debootstrap http://wiki.debian.org/Debootstrap [2] https://wiki.ubuntu.com/DebootstrapChroot https://wiki.ubuntu.com/DebootstrapChroot