The Prohacker
Verified User
- Joined
- May 23, 2003
- Messages
- 103
Alright.. So I did some googling on chrooting/jailing shell and apache since this is a very demanded feature for DirectAdmin...
Going through many web sites I've found there to be really only two methods of doing a jailed shell..
1) Modifying the OpenSSH server to support jailed enviroments.
2) Making a shell for OpenSSH to use that forces a user into a jail after the login proccess...
There are some pretty big faults with both..
1) Modifying OpenSSH:
This would require patching the daeamon itself, and if that fails, after the restart the server would be almost unfixable remotely.. If you were with an unmanaged provider like RS your only real method of recovery would be a hard drive wipe.. So that makes this a rather risky option.. Even though with RPMs this could be made fairly standard.. There is a risk... But this is the most secure way of doing a shell as I see...
2) Jailed shell, this is more attractive and seems simpler.. But less secure... Usually to allow for a jailed shell sudo must be installed:
http://tjw.org/chroot-login-HOWTO/
You'll notice everyone has root privledges when they initally log in and they are chrooted down and pushed back into their user... This is all well and fine as long as the system is properly configured.. If a user were to edit the /etc/sudoers incorrectly they could give a user or all users full root privledge on their system...
I'm not quite sure how other control panels do their jailing.. I know a certain control panel has a jail shell method and I beleive he uses mount --bind for the method instead of chroot directly... But I'm not quite sure..
As far as chrooting Apache.. This isn't going to be much fun either.. To do a proper jailed Apache.. at least a single instance of Apache needs to be run at all times for each user thats chrooted.. And that would be fine for selected users on the system.. But could be hell if all users were chrooted by default...
Using mod_become could overcome a few things but this is also a security problem because it means Apache nees to run as root instead as the user 'apache':
http://www.snert.com/Software/mod_become/index.shtml
Any others have comments on all this that might be system administrators? I'm sure John wouldn't mind a few extra opions on this since its a feature thats really in demand...
Going through many web sites I've found there to be really only two methods of doing a jailed shell..
1) Modifying the OpenSSH server to support jailed enviroments.
2) Making a shell for OpenSSH to use that forces a user into a jail after the login proccess...
There are some pretty big faults with both..
1) Modifying OpenSSH:
This would require patching the daeamon itself, and if that fails, after the restart the server would be almost unfixable remotely.. If you were with an unmanaged provider like RS your only real method of recovery would be a hard drive wipe.. So that makes this a rather risky option.. Even though with RPMs this could be made fairly standard.. There is a risk... But this is the most secure way of doing a shell as I see...
2) Jailed shell, this is more attractive and seems simpler.. But less secure... Usually to allow for a jailed shell sudo must be installed:
http://tjw.org/chroot-login-HOWTO/
You'll notice everyone has root privledges when they initally log in and they are chrooted down and pushed back into their user... This is all well and fine as long as the system is properly configured.. If a user were to edit the /etc/sudoers incorrectly they could give a user or all users full root privledge on their system...
I'm not quite sure how other control panels do their jailing.. I know a certain control panel has a jail shell method and I beleive he uses mount --bind for the method instead of chroot directly... But I'm not quite sure..
As far as chrooting Apache.. This isn't going to be much fun either.. To do a proper jailed Apache.. at least a single instance of Apache needs to be run at all times for each user thats chrooted.. And that would be fine for selected users on the system.. But could be hell if all users were chrooted by default...
Using mod_become could overcome a few things but this is also a security problem because it means Apache nees to run as root instead as the user 'apache':
http://www.snert.com/Software/mod_become/index.shtml
Any others have comments on all this that might be system administrators? I'm sure John wouldn't mind a few extra opions on this since its a feature thats really in demand...