<?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>Linux Explore &#187; centos 6</title>
	<atom:link href="https://blog.linuxexplore.com/tag/centos-6/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.linuxexplore.com</link>
	<description>Exploring Linux</description>
	<lastBuildDate>Mon, 07 Apr 2014 00:30:50 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>CentOS 6 CD/DVD/ISO to USB Installation</title>
		<link>https://blog.linuxexplore.com/2014/03/17/centos-6-cd-dvd-iso-to-usb-installation/</link>
		<comments>https://blog.linuxexplore.com/2014/03/17/centos-6-cd-dvd-iso-to-usb-installation/#comments</comments>
		<pubDate>Mon, 17 Mar 2014 18:01:41 +0000</pubDate>
		<dc:creator><![CDATA[linuxexplore]]></dc:creator>
				<category><![CDATA[Linux Explore Tips & Tricks]]></category>
		<category><![CDATA[Bootable USB]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[centos 6]]></category>
		<category><![CDATA[iso2usb]]></category>
		<category><![CDATA[isotousb]]></category>
		<category><![CDATA[liveusb-creater]]></category>
		<category><![CDATA[pendrive Linux]]></category>
		<category><![CDATA[UNetbootin]]></category>
		<category><![CDATA[Universal-USB-Installer]]></category>
		<category><![CDATA[USB software]]></category>

		<guid isPermaLink="false">http://linuxexplore.com/?p=828</guid>
		<description><![CDATA[I tried various Linux ISO to USB software like UNetbootin, liveusb-creator, Universal-USB-Installer etc to create CentOS 6 (take a look at new look of CentOS website) bootable USB/pendrive. But all have some problems or limitations which force me to use ISO2USB software, which help me to meet my need. Requirement Create a CentOS 6 bootable&#8230;]]></description>
				<content:encoded><![CDATA[<p>I tried various Linux ISO to USB software like <a title="UNebootin" href="http://unetbootin.sourceforge.net/" target="_blank"><strong>UNetbootin</strong></a>, <a title="liveusb-creator" href="https://fedorahosted.org/liveusb-creator/" target="_blank"><strong>liveusb-creator</strong></a>, <a title="Universal-USB-Installer" href="http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/" target="_blank"><strong>Universal-USB-Installer</strong></a> etc to create CentOS 6 (take a look at new look of <a title="CentOS" href="http://www.centos.org/" target="_blank">CentOS website</a>) bootable <strong>USB</strong>/<strong>pendrive</strong>. But all have some problems or limitations which force me to use <a title="ISO2USB" href="http://iso2usb.sourceforge.net/" target="_blank"><strong>ISO2USB</strong></a> software, which help me to meet my need.</p>
<h3>Requirement</h3>
<p>Create a CentOS 6 bootable USB which will support customized installation (by using kickstart configuration file).</p>
<h3>Limitations with other software</h3>
<p><strong>UNetbootin</strong>: Bootable USB of CentOS 6 created by UNetbootin is not even booting the system using USB and not support kickstart configuration file.</p>
<p><strong>liveusb-creator</strong>: It support live Linux Fedora OS only like fedora-live and not support kickstart configuration file.</p>
<p><strong>Universal-USB-Installer</strong>: It successfully boot the CentOS 6 from USB but failed to install by kickstart configuration file.</p>
<h3>Prerequisites of ISO2USB software</h3>
<p>This is the minimum requirement for all ISO to USB software. It need followings:</p>
<ul>
<li>ISO file or CD/DVD of CentOS 6 (Custom Installation disk of CentOS 6).</li>
<li>A USB drive to boot the system.</li>
</ul>
<h3>Prepare CentOS 6 bootable from ISO file or CD/DVD</h3>
<p>After <strong><a title="Download ISO2USB Software" href="https://sourceforge.net/projects/iso2usb/files/latest/download" target="_blank">downloading ISO2USB software</a></strong> for Windows, follow the steps given below:</p>
<ul>
<li>Plug the USB drive to Windows XP/Vista/7 machine.</li>
<li>Execute the ISO2USB software.</li>
</ul>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-829" alt="ISO2USB Software" src="http://linuxexplore.files.wordpress.com/2014/03/iso2usb-1.png" width="540" height="448" /><em>ISO2USB Software</em></p>
<ul>
<li>Browse CentOS 6 ISO (with custom installation) file by using the highlighted browse button.</li>
</ul>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-830" alt="Browse Custom CentOS-6 ISO file" src="http://linuxexplore.files.wordpress.com/2014/03/iso2usb-2.png" width="540" height="448" /><em>Browse Custom CentOS-6 ISO file</em></p>
<ul>
<li>Click on OK button but before clicking on OK button; just make sure that correct USB drive should be selected.</li>
</ul>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-831" alt="Select USB drive" src="http://linuxexplore.files.wordpress.com/2014/03/iso2usb-3.png" width="540" height="448" /><em>Select USB drive</em></p>
<ul>
<li>Click Exit button, when finished.</li>
</ul>
<p style="text-align:center;"><img class="aligncenter size-full wp-image-832" alt="Exit ISO2USB" src="http://linuxexplore.files.wordpress.com/2014/03/iso2usb-4.png" width="540" height="448" /><em>Exit ISO2USB</em></p>
<ul>
<li>Safely remove USB drive from Windows XP/Vista/7 system.</li>
</ul>
<p>USB drive is now ready to install CentOS 6 (with custom configuration file) on your system.</p>
<p><!--[if gte mso 9]&gt;--></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.linuxexplore.com/2014/03/17/centos-6-cd-dvd-iso-to-usb-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chroot SFTP Users for Web Hosting Server.</title>
		<link>https://blog.linuxexplore.com/2013/02/20/chroot-sftp-users-for-web-hosting-server/</link>
		<comments>https://blog.linuxexplore.com/2013/02/20/chroot-sftp-users-for-web-hosting-server/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 20:37:25 +0000</pubDate>
		<dc:creator><![CDATA[linuxexplore]]></dc:creator>
				<category><![CDATA[Linux Explore How to]]></category>
		<category><![CDATA[centos 6]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[chroot jail]]></category>
		<category><![CDATA[chroot sftp]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[internal-sftp]]></category>
		<category><![CDATA[kernel version]]></category>
		<category><![CDATA[Linux Security]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[openssh-server]]></category>
		<category><![CDATA[openssh-server-5.3]]></category>
		<category><![CDATA[public_html]]></category>
		<category><![CDATA[restorecon]]></category>
		<category><![CDATA[selinux chroot]]></category>
		<category><![CDATA[setsebool]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[SFTP CentOS]]></category>
		<category><![CDATA[sftp chroot]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ssh public key]]></category>
		<category><![CDATA[SSH server]]></category>
		<category><![CDATA[sshd_config]]></category>
		<category><![CDATA[ssh_chroot_rw_homedirs]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[unix operating systems]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://linuxexplore.com/?p=717</guid>
		<description><![CDATA[A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally not access) files outside the designated directory tree. The term &#8220;chroot&#8221; may refer to the chroot(2) system&#8230;]]></description>
				<content:encoded><![CDATA[<p>A <b>chroot</b> on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally not access) files outside the designated directory tree. The term &#8220;chroot&#8221; may refer to the <tt>chroot(2)</tt> system call or the <tt>chroot(8)</tt> wrapper program. The modified environment is called a &#8220;chroot jail&#8221;. From <a title="Chroot" href="http://en.wikipedia.org/wiki/Chroot" target="_blank">Wikipedia</a>.</p>
<p>Why it is required? If you want to set up your Linux box as a web hosting server for its users, you may need to give SFTP access. But they can get access to whole system Linux tree, just for reading but still very unsecure. So it is mandatory to lock them in their home directory.</p>
<p>There are many other applications, it&#8217;s just a common example, so lets start its configuration.</p>
<h2>Linux Box Detail:</h2>
<p>Its mine Linux Box, your Linux system may vary. Only thing to take care is the openssh-server version, because openssh-server-5.3p1 support SFTP chroot. Older version supports but its tricky, please let me k now if you want to know that too.</p>
<p lang="en-IN"><strong>Operating System:</strong> CentOS 6.3/x86_64</p>
<p lang="en-IN"><strong>Kernel Version:</strong> 2.6.32-279.19.1.el6/x86_64</p>
<p lang="en-IN"><strong>Openssh Server Version:</strong> openssh-server-5.3p1-81.el6_3/x86_64</p>
<pre><a href="http://linuxexplore.files.wordpress.com/2013/02/chroot-ori12.png"><img class="aligncenter size-large wp-image-728" alt="chroot-ori1" src="http://linuxexplore.files.wordpress.com/2013/02/chroot-ori12.png?w=610" width="610" height="328" /></a></pre>
<h2>sshd Server Configuration:</h2>
<p>Add the following tail output to your Linux box&#8217;s SSH</p>
<p>server configuration file /etc/ssh/sshd_config.</p>
<pre>[rahulpanwar@myhost ~]# tail -6 /etc/ssh/sshd_config
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Match Group www-hosting
ChrootDirectory %h
ForceCommand internal-sftp
AllowTcpForwarding no</pre>
<p lang="en-IN">Then restart sshd service to enable this configuration.</p>
<pre>[rahulpanwar@myhost ~]# sudo /etc/init.d/sshd restart</pre>
<h2>Create Chroot Users:</h2>
<pre>[rahulpanwar@myhost ~]# sudo mkdir /etc/skel/public_html
[rahulpanwar@myhost ~]# sudo groupadd www-hosting
[rahulpanwar@myhost ~]# sudo useradd -s /sbin/nologin -g www-hosting linuxexplore.com</pre>
<h2>Setting Permissions:</h2>
<pre>[rahulpanwar@myhost ~]# sudo chown root:www-hosting /home/linuxexplore.com
[rahulpanwar@myhost ~]# sudo chmod 755 /home/linuxexplore.com</pre>
<p lang="en-IN">That’s all now create multiple users for web hosting, and offer the secure sftp access to your customers.</p>
<h2>Shell Script to Create Web Hosting Users:</h2>
<pre>#!/bin/bash
HOSTING_DIR="/etc/skel/public_html"
CHROOT_GRP="www-hosting"
USR_NAME="$1"

[ ! -d "$HOSTING_DIR" ] &amp;&amp; mkdir -p $HOSTING_DIR
grep ^"${CHROOT_GRP}:" /etc/group || /usr/sbin/groupadd www-hosting
grep ^"${USR_NAMEP}:" /etc/passwd || /usr/sbin/useradd -s /sbin/nologin -g $CHROO_GRP $USR_NAME
chown root:$CHROOT_GRP /home/$USR_NAME
chmod 755 /home/$USR_NAME</pre>
<h2>Selinux Configuration:</h2>
<p lang="en-IN"><a title="Selinux disable temporarily or permanently" href="http://linuxexplore.com/2012/08/04/selinux-disable-temporarily-or-permanently/" target="_blank">Disable the selinux permanently</a> or configure it for read write user&#8217;s home directory in SSH chroot.</p>
<pre>[rahulpanwar@myhost ~]# sudo setsebool -P ssh_chroot_rw_homedirs on
<span style="color:#333333;"><span style="font-family:Monaco, Consolas, Andale Mono, DejaVu Sans Mono, monospace;"><span style="font-size:small;">[rahulpanwar@myhost ~]# sudo restorecon -R /home/$USERNAME</span></span></span></pre>
<h2>Troubleshooting</h2>
<p lang="en-IN">From: <span style="color:#0000ff;"><span style="text-decoration:underline;"><a href="https://wiki.archlinux.org/index.php/SFTP-chroot">https://wiki.archlinux.org/index.php/SFTP-chroot</a></span></span></p>
<pre>sshd[3505]: fatal: bad ownership or modes for chroot directory "/home/linuxexplore.com"</pre>
<p>It&#8217;s ChrootDirectory ownership problem, sshd will reject sftp connections to accounts that are set to chroot into any directory that has ownership/permissions that sshd doesn&#8217;t consider secure. sshd&#8217;s apparently strict ownership/permissions requirements dictate that every directory in the chroot path must be owned by root and only writable for the owner. So, for example, if the chroot environment is in a user&#8217;s home directory both /home and /home/username must be owned by root and have permissions like 755 or 750 ( group ownership should allow user to access ).</p>
<p>If you are using sftp with public key check the following link:</p>
<p><a href="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=37903&amp;forum=59">http://www.centos.org/modules/newbb/viewtopic.php?topic_id=37903&amp;forum=59</a></p>
<p>If chroot environment is in user&#8217;s home directory, make sure user have access to its home directory, or user would not be able to access its publickey, produce the error given in above <a title="CentOS 6" href="http://centos.org" target="_blank">CentOS</a> forum link.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.linuxexplore.com/2013/02/20/chroot-sftp-users-for-web-hosting-server/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
