Personal tools
You are here: Home Hobbies Computers FreeBSD Jail: Create

Jail: Create

Creating a jail with EZJail

Preface

Although you can maintain your FreeBSD jails manually and there are quite a few tutorials around, I like the implementation done through EZJails.

It's assumed you have completed installing FreeBSD and EZJail.

 

Creating/Starting a Jail

To create the jail we need to create an alias for the network interface, issue the ezjail-admin create command w/flavor, and finally start the jail:

ifconfig lnc0 192.168.1.50 netmask 255.255.255.255 alias
ezjail-admin create -f standard www.kingsquarry.net 192.168.1.50
/usr/local/etc/rc.d/ezjail.sh start www.kingsquarry.net

Once the jail is started it's critical that we login and perform a couple clean-up tasks (setting root's password, time zone, and finishing the sendmail configuration):

ssh 192.168.1.50 -l admin
passwd   <- Change your password
su -
passwd   <- Give a password for the root account
tzsetup
cd /etc/mail
make install-submit-cf
/etc/rc.d/sendmail restart
exit
exit

Since we've disabled the sendmail solution we'll need to redirect all command-line generated mail to our real server, besides jails cannot talk on the localhost address (127.0.0.1).  First, we need to create the submit file:

cd /etc/mail
make install-submit-cf

Edit the mc file (fqdn.submit.mc) created by running the above command and change the existing "FEATURE(`msp'...):

dnl FEATURE(`msp', `[127.0.0.1]')dnl
FEATURE(`msp', `[your.mail.server.here.net]')dnl

Save the above changes and once again execute the following:

make install-submit-cf

Finally, make sure your eMail server is configured properly to receive eMail from and, possibly, to recieve eMail directed to this host.

Logout of the jail, returning to the host BSD session and, if needed, add the alias to the /etc/rc.conf file:

ifconfig_lnc0_alias0="192.168.1.50 netmask 0xffffffff"

 

Conclusion

You should now have a base Jail with associated flavor for creating some initial items.  If you have a constant DNS setup then adding resolv.conf to the standard flavour would be a nice time saver.

 

Document Actions
« July 2010 »
July
SuMoTuWeThFrSa
123
45678910
11121314151617
18192021222324
25262728293031
Huntersville, NC Weather

Current Conditions
@

Temp :
Humidity :
Barometer :

Forecast