chroot like program for non-root users
Hi
I want all the users to be capable of chroot-ing to a folder without getting extra security risks. I need this because I have a folder structure with a program inside and I can't make the program work in the original root. I tested the program with root by chrooting and it works fine, but I need that all the users can use this program. Any suggestion? Thanx in advance |
My suggestion would be to make a little script in the user's path that is setuid root, which chroots them into that directory. Be very careful that the script is written correctly, else it's as dangerous as any other setuid root file.
|
Quote:
|
Really? To be honest, I'd never tried. Well, I suppose you could just setuid chroot itself, but I'd need to think about the security consequences of that before I can really recommend it.
|
Quote:
|
You can allow user to do chroot via sudo.
Valery. |
What’s wrong with something like jk_chrootsh (which comes as part of Jailkit)? Alternatively, you could create a script as PatrickNew suggested but instead of making it SUID (which won’t work on linux unless you use binfmt_misc), make an entry for it in sudoers.
|
Perhaps plash might be suitable for this application?
|
You also can choose totally different approach:
use Ermine (http://magicErmine.com) or statifier (http://statifier.sf.net) to create standalone executablefrom you program in question. Than this standalone executable can be run in the original root, eliminating the problem altogether. |
Quote:
|
Quote:
In this case Ermine/statifier are relevant. If the reason is security, than indeed chroot based solution is way better. |
[inserts foot into mouth]
@Valery Reznic: You're exactly right. You have my apologies. @xowl: My recommendation is to pursue one of these two that Valery Reznic has referred to. They both sound like better options than chrooting for what you want to do. |
Quote:
After all may be you are right, and xowl's "can't run in original root..." is due to security consideration. Valery |
All times are GMT -5. The time now is 06:56 PM. |