HermanAB said: Yup, chroot is not worth the trouble. It does nothing for security and increases the maintenance effort a lot.
I have to say I disagree. TBH, the only reason someone should be able to own your box from a chroot is because it was jailed terribly in the first place. By no means am I trying to be inflammatory, however, if someone compromises, your web server (for example) it doesn't mean you are rooted. It can be fairly easy, depending on the person's code, to attach a PHP shell via remote file inclusion. Once you have the shell, the command 'id' will generally display the user that Apache is running as and if you are on the receiving end of this attack, you had better hope it isn't root.
Now, as the PHP shell provides a way to execute arbitrary commands on the server (with of course user/group limitations), it could be theorized that there it is only a matter of time until someone busts out of the chroot and wreaks havoc on the entire system. The truth is that there is a giant gap between being able to own a poorly secured web server via remote file inclusion vulnerability and being able to root a server with a local privilege escalation vulnerability. To summarize, most script kiddies who use google hacking to find RFI vulnerabilities are not very formidable attackers and since they cannot easily advance their exploitation from the jail, the damage they can do is limited. Most often, breaking out of a chroot jail requires things that a proper jail should not facilitate. Lastly, if they do keep at it for a reasonable amount of time, it should be on the user to monitor their security in which case targeted attacks should not go unnoticed.
For the sake of keeping it simple, no, chrooting is not fool proof but it will not only discourage most fools but it can also buy you time and give you an additional layer of security which is always a good thing.
> On military systems, use of chroot is discouraged. So if Uncle Sam doesn't want to use chroot, then you probably should not either.
Uncle Sam probably doesn't want people to use solid encryption either.