<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chroot &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/chroot/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Wed, 09 Oct 2019 11:15:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Chroot &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Configure Chroot on Debian</title>
		<link>https://help.hostry.com/knowledge-base/how-to-configure-chroot-on-debian/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-configure-chroot-on-debian/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Wed, 09 Oct 2019 11:15:07 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=781</guid>

					<description><![CDATA[Chroot is the operation of changing the root directory on Unix-like operating systems. A program launched with a modified root directory will only have access to the files contained in this directory. Dependency Installation The first thing to do is run the following installation commands, which will be explained later [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><em><a href="https://ru.wikipedia.org/wiki/Chroot">Chroot</a></em></strong> is the operation of changing the root directory on Unix-like operating systems. A program launched with a modified root directory will only have access to the files contained in this directory. </p>



<h2 id="dependency-installation" >Dependency Installation</h2>



<p>The first thing to do is run the following installation commands, which will be explained later</p>



<pre class="wp-block-code"><code>apt-get install binutils debootstrap</code></pre>



<p>Then you should choose a place to configure chroot. We recommend using will use <strong><em>/var/chroot</em></strong> directory</p>



<h3 id="Step_2__Creating_the_required_directories" id="create-the-necessary-directories" >Create the necessary directories</h3>



<p>You need a create <strong><em>chroot</em></strong> folder</p>



<pre class="wp-block-code"><code>mkdir -p /var/chroot</code></pre>



<p>This completes the setup of the preliminary steps. Next, you need to copy all the commands and their dependencies. This requires a command interpreter, so let&#8217;s copy bash.</p>



<pre class="wp-block-code"><code>mkdir -p /var/chroot/bin
cp /bin/bash /var/chroot/bin</code></pre>



<p>Having looked at all the dependencies, you can run the following program</p>



<pre class="wp-block-code"><code>ldd /bin/bash</code></pre>



<p>If you are using (for example) a 32-bit version, it will look just like this:</p>



<pre class="wp-block-code"><code>linux-gate.so.1 =>  (0xb773e000)
libtinfo.so.5 => /lib/i386-linux-gnu/libtinfo.so.5 (0xb7718000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7714000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb75c3000)
/lib/ld-linux.so.2 (0xb773f000)</code></pre>



<p>The following is the copying of files:</p>



<pre class="wp-block-code"><code>mkdir -p /var/chroot/lib 
mkdir -p /var/chroot/lib/i386-linux-gnu
cp /lib/i386-linux-gnu/libtinfo.so.5 /var/chroot/lib/i386-linux-gnu
cp /lib/i386-linux-gnu/libdl.so.2 /var/chroot/lib/i386-linux-gnu
cp /lib/i386-linux-gnu/libc.so.6 /var/chroot/lib/i386-linux-gnu</code></pre>



<h2 id="testing-the-environment" >Testing the environment</h2>



<p>Checking the bash setting</p>



<pre class="wp-block-code"><code>chroot /var/chroot</code></pre>



<p>If you need to connect to the network in chroot, you will need to run the following commands:</p>



<pre class="wp-block-code"><code>mkdir -p /var/chroot/etc
cp /etc/resolv.conf /var/chroot/etc
cp /etc/gai.conf /var/chroot/etc</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-configure-chroot-on-debian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
