Debootstrap and Chroot

Using these two simple programs you can put into production safe services (limiting damage in case of intrusion) or test program packages without the risk of creating problems on your installation of base system.

What is debootstrap?

debootstrap allows you to install Debian in a system without an installation disk but can also be used to create a very simple environment for chroot.

What is and what is the use chroot?

Chroot allows you to define the root directory of a login session or program.

In this way, for example, you can simultaneously run multiple versions of gnome or kde chrooted separate.

What you need to install the base system, for chroot:

apt-get install coreutils

per debootstrap:

apt-get install debootstrap

Here's how to create our first system in chroot, create the directory that will house our new system:

mkdir /mychroot

choose which distribution to install: woody, sarge o sid. In our case sid:

debootstrap sid /mychroot

wait until the end of the download and installation of the system in the specified directory, about 140MB.
Configure the file:

/etc/fstab

from your base system mount the filesystem /proc of the system chroot.

echo proc-sid /mychroot/proc proc none 0 0 >> /etc/fstab
mount /mychroot/proc

constitute a small part of networking in the chroot system:

echo 127.0.0.1 localhost $(hostname) > /mychroot/etc/hosts

configure the file:

/etc/apt/sources.list

of chroot to perform successfully the installation of packages of services that we want to run in chroot.

echo deb http://ftp.it.debian.org/debian/ sid main > /mychroot/etc/apt/sources.list

enter the chroot system:

chroot/mychroot

upgrate the system:

apt-get update
apt-get upgrade

it is done by running a few commands, a chroot sid updated and perfectly functioning.

The use of the information shown here is at your risk.
Cyber Methexis disclaims any liability for malfunction and/or loss of data.


Tag cloud

networking open source internet hardware sistemi operativi windows downloads tips and tricks scripting microsoft apple software linux informatica scripts sicurezza