When Not to Use chroot
Hyena writes "Linux guru Alan Cox is quoted as saying 'chroot is not and never has been a security tool' in a KernelTrap article summarizing a lengthy thread on the Linux Kernel mailing list. The discussion began with a patch attempting to 'fix a security hole' in the Unix chroot command, trying to improve the ability of chroot to contain a process. When it was pointed out that people have been using chroot as a security tool for years, another kernel hacker retorted, 'incompetent people implementing security solutions are a real problem.' A quick search on the terms 'chroot+security' quickly reveals that many people have long thought (wrongly) that chroot's purpose was for improving security."
This summary is truly and terribly misleading--the discussion simply says that a root user can break out of a chroot jail. Is this news? chroot can still be effectively used to contain processes that do not run as root.
The purpose of chroot is to change the root directory. Chroot is particularly useful for recovery and diagnostics.
If you system that won't boot due to a boot sector problem Boot from a CD, mount your partitions, chroot to your root partition and run lilo/grub/... to rewrite your boot sector.
If you system that won't boot due to init script problems Boot from a CD, mount your partitions, chroot to your root partition and run run your full init process. If you run into problems, rerun your init scripts rather than rebooting.
Unfortunately, many people think chroot is a security tool so many people don't think it in non-security contexts.
Actually, Bill Joy invented chroot as a hack to use a custom /usr/include directory in a compiler that didn't support alternate include paths.
Do you even lift?
These aren't the 'roids you're looking for.
Just because you can only run a command as a superuser doesn't mean that all of the child processes of that command have to be run as the superuser. If this were the case, since init runs as root you would not have a multiuser system.
I am TheRaven on Soylent News
https://portal.mytesting.org:8080/ (including)
* tinyHTTP (AppWeb, Apache, etc.)
* SQLite (MySQL, Postgres, etc.)
* [chroot-path-0]/www/html/*
* Other ([chroot-path-0]/usr/lib, [chroot-path-0]/bin, etc.)
and repeat...
https://my-test-env.org:8081/ https://my-test-env.org:8082/ https://my-test-env.org:8083/ https://my-test-env.org:8084/ Next, bind
Now you have 5 chroot'ed web environments to help your test team (of 5) speed up Alpha testing. May be fraught with bad security? That's not the point.
I think his comment was directed specifically at people who do not have enough understanding to implement a security solution on linux but think they do. Would the same comment coming from an official MS authority on security make you not want to use Vista?
Anyway, I do understand the perspective behind your reaction, but it doesn't fit in this specific case.
Samsung took back my unlocked bootloader because Google wants me to rent movies. They're both evil.
$ ls -l
-rwxr-xr-x 1 root root 700560 2007-04-11 09:32
$ ln
$ ls -l foo
-rwxr-xr-x 2 root root 700560 2007-04-11 09:32 foo
Uhhh, why is a regular user allowed to create a file owned by root? Apparently, you don't know what a hard link is.
You haven't created a file owned by root. You've created an i-node pointing to the data blocks of a file owned by root.
If root were to rm
Your way, I could do the following on a file with 600 permission:
cd
ln
chmod 666 mine
cat mine
Nice and easy way to get around a 600 permission.
The behavior is correct, not a bug.
Regards,
--Keith
Man, things like this make me want to NOT switch to Linux... Even though I had a better experience with Ubuntu that I did Vista. What's your problem with that statement?
It's absolutely true and it is not limited to linux.
Let's take it a few more steps further as an example: 'incompetent people designing bridges are a real problem.'
'incompetent people performing surgery are a real problem.'
'incompetent people running the government are a real problem.'
Do you have a problem with any of those statements?
If you don't even know what chroot() is, then you are not the target of the man's complaint.
When information is power, privacy is freedom.
Go ahead. One of the (many) differences between Vista and Linux is that if you want to, you can march up to any of the core Linux kernel architects and tell them they have some fundamental long-standing unix interface totally wrong. The flip side of that is that they also won't stop anyone from flaming you if you do that.
And that's exactly what happened here. This guy wasn't posting a question on a local LUG. He was posting to the Linux kernel mailing list--the place where people actually meet to do kernel development. And he wasn't asking a question, he was arguing with people like Al Viro, a primary architect of the Linux filesystem api's. Which would be great if he was correct. But in fact he was totally wrong. And even that would be OK if he took the time to do his homework and to listen carefully when people explained the issue to him.
But he didn't really, so as a result he got a few flames. Some of the posters to lkml aren't polite in such a situation. I think that's kind of understandable, though actually agree that that's a problem. Are the core Vista kernel developers any better? Who knows? Does the general public doesn't have the option of participating in their development forums?
http://blogs.sun.com/chrisg/tags/chroot
Dr. Marshall Kirk Mckusick, private communication: ``According to the SCCS logs, the chroot call was added by Bill Joy on March 18, 1982 approximately 1.5 years before 4.2BSD was released. That was well before we had ftp servers of any sort (ftp did not show up in the source tree until January 1983). My best guess as to its purpose was to allow Bill to chroot into the