User Tools

Site Tools


documentation:howto:jails:clist

Command Summary

Create proto jail

mkdir /mnt/jail
mount_nullfs /mnt/jail /jail
mkdir /jail/work	
mkdir /jail/proto	
mkdir /jail/conf	
cd /jail/work
rsync -av ftp.de.freebsd.org::FreeBSD/releases/`uname -m`/`uname -r | cut -d- -f1-2`/base/ `uname -r | cut -d- -f1-2`_`uname -m`_base
cat `uname -r | cut -d- -f1-2`_`uname -m`_base/base.?? | tar --unlink -xpzf - -C /jail/proto/
cd /jail
mkdir -p conf/root/{etc,etc/rc.d/,usr/bin,usr/sbin}
cp proto/etc/rc.d/jail conf/root/etc/rc.d/
cp proto/usr/sbin/{jail,jexec,jls} conf/root/usr/sbin/
cp proto/usr/bin/mktemp conf/root/usr/bin/
cp /etc/resolv.conf /jail/proto/etc/
echo "nameserver 213.73.91.35" > /jail/proto/etc/
cp proto/usr/share/zoneinfo/Europe/Berlin proto/etc/timezone
touch conf/fstab.proto
touch conf/rc.conf.local
cat << ! > conf/rc.conf.local
jail_enable="YES"
jail_list="proto"	
jail_proto_rootdir="/jail/proto"
jail_proto_hostname="proto.domain.local"
jail_proto_ip="192.168.1.20"		
jail_proto_interface="rl0"		
jail_proto_devfs_enable="YES"		
jail_proto_mount_enable="YES"				
jail_proto_fstab="/jail/conf/fstab.proto"
!

cat << ! > conf/jail_start
mkdir /jail
mount_nullfs /mnt/jail /jail
cp -r /jail/conf/root/ /
rehash
ln -s /jail/conf/rc.conf.local /etc
/etc/rc.d/jail start
!

chmod 755 conf/jail_start
/jail/conf/jail_start
rehash
echo "Following jail's are up and running:"
jls
documentation/howto/jails/clist.txt · Last modified: 2018/07/08 17:01 (external edit)