Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 5th October 2007, 17:59
PacketPaul PacketPaul is offline
Junior Member
Join Date: Oct 2007
Posts: 14
Thanks: 3
Thanked 1 Time in 1 Post
Default Bug in chroot environment

I have created two users, Sam and Alfred with Alfred being the administrator. The home directories in the passwd file are set as follows:


Notice the home directory for Alfred is the root directory of the entire site and not the more logical /var/www/web5/./user/web5_alfred.

Why is this important? Because Dovecot looks for the Maildir in the home directory (i.e. ~/Maildir). Thus Dovecot can not find the administrators e-mail which is being stored at /var/www/web5/user/web5_alfred/Maildir.

While I realize I can write a script that Dovecot will call to set the e-mail directory based upon if the user is an administrator, for simplicity, all e-mail should be stored in a similar location. The fix is quite simple, the home directory in the passwd file needs to be changed from:

/var/www/web5/./ to /var/www/web5/./users/web5_alfred

Second issue:
Is it really necessary to give sam his own chroot environment? That seems like a waste of space. I imagine most people would find it acceptable that all users are chrooted to the root directory of the site.

Take care,

Reply With Quote
Sponsored Links
Old 5th October 2007, 19:36
PacketPaul PacketPaul is offline
Junior Member
Join Date: Oct 2007
Posts: 14
Thanks: 3
Thanked 1 Time in 1 Post

Ok, this the the modifications required. All are in config.lib.php:

Around line 632, delete the following:

$mod->system->adduser($user_username, $userid, $gid_web, $user_name, $web_path.$chroot_addpath, $shell, $passwort);
} else {
$mod->system->adduser($user_username, $userid, $gid_web, $user_name, $web_path."/user/".$user_username.$chroot_addpath, $shell, $passwort);

Replace with:

$mod->system->adduser($user_username, $userid, $gid_web, $user_name, $web_path.$chroot_addpath."user/".$user_username, $shell, $passwort);

and delete/comment out the line 767 and 768:

// Chroot enviroment erstellen
if($go_info["server"]["ssh_chroot"] == 1) {
exec("/root/ispconfig/scripts/shell/create_chroot_env.sh $user_username");

Take care,

Reply With Quote
The Following User Says Thank You to PacketPaul For This Useful Post:
mlz (6th October 2007)


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bind chroot configuration Toffee Installation/Configuration 6 13th March 2009 16:51
A question about chroot rafael-ec General 3 3rd August 2007 10:19
Postfix chroot ? knivla Server Operation 9 21st July 2007 07:35
Installing MySQL, Apache, and PHP in a chroot environment fishfreak Suggest HOWTO 2 24th January 2007 00:21
ssh chroot works, but no scp for chroot users zokahn HOWTO-Related Questions 5 30th January 2006 10:33

All times are GMT +2. The time now is 19:24.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.