<?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>Zelut's Blog &#187; CentOS</title> <atom:link href="http://blog.zelut.org/category/centos/feed/" rel="self" type="application/rss+xml" /><link>http://blog.zelut.org</link> <description>Brain Dump of a Linux Admin</description> <lastBuildDate>Mon, 12 Jul 2010 14:15:55 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=abc</generator> <item><title>Configure Serial Console Access on CentOS 5</title><link>http://blog.zelut.org/2010/05/05/configure-serial-console-access-on-centos-5/</link> <comments>http://blog.zelut.org/2010/05/05/configure-serial-console-access-on-centos-5/#comments</comments> <pubDate>Thu, 06 May 2010 03:21:42 +0000</pubDate> <dc:creator>Christer</dc:creator> <category><![CDATA[CentOS]]></category> <category><![CDATA[access]]></category> <category><![CDATA[centos5]]></category> <category><![CDATA[console]]></category> <category><![CDATA[serial]]></category> <category><![CDATA[virsh]]></category><guid isPermaLink="false">http://blog.zelut.org/?p=178</guid> <description><![CDATA[Today I built some virtual machines on a KVM platform (Ubuntu 10.04 Server as the host). The three virtual machines are CentOS 5, i386 and will be used primarily for internal application testing. One of the requirements for using these machines in a virtual environment was configuring back-end console access from the host. The virtual [...]]]></description> <content:encoded><![CDATA[<p>Today I built some virtual machines on a KVM platform (Ubuntu 10.04 Server as the host). The three virtual machines are CentOS 5, i386 and will be used primarily for internal application testing. One of the requirements for using these machines in a virtual environment was configuring back-end console access from the host. The virtual machine management tools (virsh) provide custom commands to console into your guest machines, but the guest machines need to be configured to output to the proper console. This article outlines what customizations I made to the CentOS 5 virtual machines in order to console into them from the host using &#8216;virsh console &lt;guest&gt;&#8217;</p><p><strong>GRUB</strong></p><p>The first modifications that I needed to make were in GRUB. On CentOS the GRUB config file can be found at: <code>/boot/grub/menu.lst</code>. Below you&#8217;ll find the changes I made:</p><blockquote><p><code>default=0<br /> timeout=5<br /> #splashimage=(hd0,0)/grub/splash.xpm.gz<br /> serial --unit=0 --speed=115200<br /> terminal --timeout=10 console serial<br /> hiddenmenu</code></p></blockquote><p>I&#8217;m sure if you compare that snippet with your current configuration you&#8217;ll see the changes that I&#8217;ve implemented. Primarily the commenting of the splashimage, and the addition of the serial and terminal lines.</p><p>In addition to these changes you&#8217;ll also need to append some console configurations to each &#8216;kernel&#8217; line. Here is an example:</p><blockquote><p><code>title CentOS (2.6.18-164.15.1.el5)<br /> root (hd0,0)<br /> kernel /vmlinuz-2.6.18-164.15.1.el5 ro root=/dev/SLIM/root console=tty0 console=ttyS0,115200n8<br /> </code></p></blockquote><p>Again, compare this to your current configuration. You&#8217;ll notice I&#8217;ve added <code>console=tty0 console=ttyS0,115200n8</code></p><p><strong>/etc/inittab</strong></p><p>Finally you&#8217;ll need to make a change to the /etc/inittab file, which will allow login via the serial console connection:</p><blockquote><p><code>S0:2345:respawn:/sbin/agetty ttyS0 115200 linux<br /> </code></p></blockquote><p>Once these changes have been applied you should be able to reboot and connect to the console:</p><p><code>virsh console &lt;guest&gt; </code>should then display the GRUB menu, boot output and finally a login.</p> ]]></content:encoded> <wfw:commentRss>http://blog.zelut.org/2010/05/05/configure-serial-console-access-on-centos-5/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>JailKit : How To Create SSH Jails</title><link>http://blog.zelut.org/2009/06/12/jailkit-how-to-create-ssh-jails/</link> <comments>http://blog.zelut.org/2009/06/12/jailkit-how-to-create-ssh-jails/#comments</comments> <pubDate>Fri, 12 Jun 2009 16:53:05 +0000</pubDate> <dc:creator>Christer</dc:creator> <category><![CDATA[CentOS]]></category> <category><![CDATA[FreeBSD]]></category> <category><![CDATA[chroot]]></category> <category><![CDATA[jail]]></category> <category><![CDATA[JailKit]]></category> <category><![CDATA[SSH]]></category><guid isPermaLink="false">http://blog.zelut.org/?p=150</guid> <description><![CDATA[Not long ago we rebuilt a number of servers within our production environment at work, migrating from FreeBSD to CentOS. One of the requirements in this migration was that we needed a server that would act as an SSH-only Jail on the new platform. This meant I needed to setup a system where users could [...]]]></description> <content:encoded><![CDATA[<p>Not long ago we rebuilt a number of servers within our production environment at work, migrating from FreeBSD to CentOS. One of the requirements in this migration was that we needed a server that would act as an SSH-only Jail on the new platform. This meant I needed to setup a system where users could SSH into a machine but the <em><strong>only</strong></em> thing they could do on that machine was SSH back out again. We used this as our &#8220;bounce&#8221; machine. Users would have outside access to their Desktops or other machines only by way of this secured SSH-only machine.</p><p>The solution I found was a tool called &#8220;<a title="JailKit" href="http://olivier.sessink.nl/jailkit/">JailKit</a>&#8220;, which allows you to create chroot jails is a very simple way. Below I&#8217;ll outline the requirements for installing JailKit and using it to create an SSH chrooted &#8220;Jail&#8221;.</p><p><strong>Step 1: Install JailKit</strong></p><p>I was unable to find an up to date package for JailKit on CentOS, so I did the following to install from source:</p><blockquote><p><code> yum install gcc make<br /> wget -c http://olivier.sessink.nl/jailkit/jailkit-2.7.tar.bz2<br /> tar xf jailkit-*.tar.bz2<br /> cd jailkit-*<br /> ./configure<br /> make<br /> make install<br /> </code></p></blockquote><p><strong>Step 2: Configuration</strong></p><p>Once you have JailKit built and installed you&#8217;ll need to configure it to provide the needed libraries and devices for your chroot SSH setup. Below is an example configuration I used for a JailKit setup on CentOS 5 x86_64 (using JailKit 2.5 at the time). <em>Note: This is not the entire configuration. These three sections, <code>uidbasics</code>, <code>ssh</code> and <code>basicshell</code> required minor changes and this was the end-product of those changes:</em></p><blockquote><p><code> [uidbasics]<br /> comment = common files for all jails that need user/group information<br /> libraries = /lib/libnsl.so.1, /lib64/libnsl.so.1, /lib/libnss*.so.2, /lib64/libnss*.so.2<br /> regularfiles = /etc/nsswitch.conf<br /> emptydirs = /home</code></p><p><code>[ssh]<br /> comment = ssh secure shell<br /> executables = /usr/bin/ssh<br /> includesections = netbasics, uidbasics<br /> devices = /dev/urandom, /dev/tty, /dev/null</code></p><p><code> </code><code>[basicshell]<br /> comment = bash based shell with several basic utilities<br /> executables = /bin/sh, /bin/bash, /bin/ls, /bin/cat, /bin/chmod, /bin/mkdir, /bin/cp, /bin/cpio, /bin/date, /bin/dd, /bin/echo, /bin/egrep, /bin/false, /bin/fgrep, /bin/grep, /bin/gunzip, /bin/gzip, /bin/ln, /bin/ls, /bin/mkdir, /bin/mktemp, /bin/more, /bin/mv, /bin/pwd, /bin/rm, /bin/rmdir, /bin/sed, /bin/sleep, /bin/sync, /bin/tar, /bin/touch, /bin/true, /bin/uncompress, /bin/zcat, /usr/bin/id<br /> regularfiles = /etc/motd, /etc/issue, /etc/bash.bashrc, /etc/bashrc, /etc/profile<br /> directories = /usr/lib/locale/en_US.utf8<br /> users = root<br /> groups = root<br /> includesections = uidbasics<br /> </code></p></blockquote><p><strong>Step 3: Populate The Jail Environment</strong></p><p>Once these changes are made JailKit should be configured to provide the needed libraries and devices to your SSH chroot. You can now generate the chroot by using these two commands:</p><blockquote><p><code> jk_init -v -f /home/chrootusers/ ssh<br /> jk_init -v -f /home/chrootusers/ basicshell<br /> </code></p></blockquote><p><strong>Step 4: Generate Users</strong></p><p>The final step in an SSH-chroot Jail setup is the creation of users. This step is a bit more complicated due to the fact that the users need to be created within the chroot setup <em>and</em> on the host system itself. The users will never have access to the host system, but that is where the initial authentication happens. Once they are authenticated they are pushed into the chroot jail and have limited permissions.</p><p>This script assumes two things that you should be aware of. If your configuration doesn&#8217;t match you&#8217;ll need to update the script accordingly:</p><ol><li>This script assumes your chrooted jail home directories will be in <code>/home/chrootusers/</code>.</li><li>This script assumes group-based SSH restrictions using a system group called <code>sshaccess</code>.</li><li>This script also attempts to create storage restrictions using filesystem quotas, but succeeds if quotas are not enabled. (See Appendix for information on enabling quotas.)</li></ol><p>Here is the script:</p><blockquote><p><code> #!/bin/bash<br /> #<br /> # This code is released under the Public Domain.<br /> # create jailed ssh accounts<br /> # christer.edwards@gmail.com<br /> # usage: ./chroot-jail username 'passwdhash'<br /> #</code></p><p><code>## sanity checks<br /> if [ $# -ne 2 ]; then<br /> echo "This application requires two arguments: username 'passwdhash' (single-quotes required)"<br /> exit 1<br /> fi</code></p><p><code>if [ ! -d /home/chrootusers/./home/ ]; then<br /> echo "This application assumes installation to /home/chrootusers"<br /> exit 1<br /> fi</code></p><p><code>getent passwd $1 &amp;&gt;/dev/null<br /> if [ $? -eq 0 ]; then<br /> echo "User $1 already exists on host system.  Please remove and re-create using this tool."<br /> exit 1<br /> fi</code></p><p><code>getent group sshaccess &amp;&gt;/dev/null<br /> if [ $? -ne 0 ]; then<br /> echo "This application assumes 'AllowGroups sshaccess' restriction in /etc/ssh/sshd_config. sshaccess group missing"<br /> exit 1<br /> fi</p><p>## creation<br /> echo<br /> echo "Creating User and Jailed Home Directory"<br /> echo<br /> useradd -m -d /home/chrootusers/./home/$1 -s /usr/sbin/jk_chrootsh -p $2 $1</p><p>echo "Adding User to 'sshaccess' Group"<br /> echo<br /> gpasswd -a $1 sshaccess &amp;&gt;/dev/null</p><p>JAILUID=$(id -u $1)<br /> JAILGID=$(id -g $1)</p><p>echo "Creating Required Internal Jail Passwd and Group Files"<br /> echo<br /> echo "$1:x:${JAILUID}:${JAILUID}::/home/$1:/bin/bash" &gt;&gt; /home/chrootusers/etc/passwd<br /> echo "$1:x:${JAILGID}:" &gt;&gt; /home/chrootusers/etc/group</p><p></code><code> echo "Applying Quota Restrictions"<br /> setquota -u $1 10240 15360 0 0 /home || echo "Unable to Apply Quota Restrictions.  Are Quotas enabled?"<br /> </code></p></blockquote><p>If you create all of your users using this script you should save yourself a fair amount of headache. Between the user-creation script and the JailKit tools, creating SSH chrooted jails becomes a very simple task.</p><p><strong>Appendix: Enabling Quotas</strong></p><p>When I first implemented this JailKit setup in production I invited a few of the users to do their worst to break out of the jail or otherwise interfere with the system and other users. One of the potential problems that we found was that of drive space. Because there were no storage limitations for the chrooted users, one user could create large files and interfere with the others (or the host system) by filling up the drive. Below I&#8217;ve outlined how to activate filesystem quotas on Red Hat Enterprise or CentOS machines and apply a 15M hard limit to your chrooted users:</p><p><strong>Configure usrquota</strong></p><p>Quotas are a filesystem-based feature that needs to be activated within the fstab. To activate the use of persistent quotas append the term &#8220;usrquota&#8221; to the mount options of /home/ in your fstab. Example:</p><blockquote><p><code>/dev/LocalVol/HOME    /home    ext3    defaults,usrquota    1 2</code></p></blockquote><p><strong>Activate usrquota</strong></p><p>Once this is configured the following four commands will install, configure and activate quotas.</p><blockquote><p><code>yum install quota<br /> mount -o remount /home/<br /> quotacheck -cmu /home/<br /> quotaon /home/</code></p></blockquote><p>At this point you aren&#8217;t applying any limits to the user (yet), but the quota management system is on and active. If you create your users using the script above they will be given a 10M soft limit (after 10M they will be given a warning) and a 15M hard limit (absolutely no more disk writes). You can change these values (last line in the script) based on your needs.</p> ]]></content:encoded> <wfw:commentRss>http://blog.zelut.org/2009/06/12/jailkit-how-to-create-ssh-jails/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>mrepo: RPM Repository Mirroring</title><link>http://blog.zelut.org/2009/06/12/mrepo-rpm-repository-mirroring/</link> <comments>http://blog.zelut.org/2009/06/12/mrepo-rpm-repository-mirroring/#comments</comments> <pubDate>Fri, 12 Jun 2009 15:37:48 +0000</pubDate> <dc:creator>Christer</dc:creator> <category><![CDATA[CentOS]]></category> <category><![CDATA[RPM]]></category> <category><![CDATA[mirror]]></category> <category><![CDATA[Red Hat]]></category> <category><![CDATA[repository]]></category> <category><![CDATA[RHN]]></category><guid isPermaLink="false">http://blog.zelut.org/?p=135</guid> <description><![CDATA[Today I have finally found some time to catch up on my blogging. I&#8217;ve got a whole slew of backlogged information that I want to post, so hopefully my fingers (and my brain!) can keep up long enough to get it all published. The topic I wanted to start with today is mrepo: RPM Repository [...]]]></description> <content:encoded><![CDATA[<p>Today I have finally found some time to catch up on my blogging. I&#8217;ve got a whole slew of backlogged information that I want to post, so hopefully my fingers (and my brain!) can keep up long enough to get it all published. The topic I wanted to start with today is mrepo: RPM Repository Mirroring made easy.</p><p>Mrepo is a tool developed by Dag Wieers of <a title="Dag Wieers RPM Packages" href="http://dag.wieers.com/rpm/">rpmforge</a> fame. If you&#8217;ve ever run an RPM based distribution (Red Hat, Fedora, CentOS, etc) you&#8217;ve very likely heard of Dag Wieers. He keeps the package machine running and provides those packages not otherwise available in the core repositories. I read that he developed this tool to help streamline the creation and deployment of RPM mirrors and network install servers, which he so often needed in dealing with clients.</p><p>I used this exact setup to create and maintain an internal repository for our company which supplies network-based installation capabilities for Red Hat Enterprise 3, 4 and 5, CentOS 3, 4 and 5, Fedora 10 and 11, and openSUSE. This allows us to more quickly deploy new servers as well as saving bandwidth when applying errata to hundreds of servers and desktops.</p><p>Before I dive into the nuts and bolts of this operation there are a few things that are assumed with this setup. You should be aware of these so that you know what to expect and/or you can update your preferences accordingly.</p><ol><li>The export and storage location I prefer is <code>/var/ftp/pub</code>, with the DVD images stored in a subdirectory of <code>/var/ftp/pub/.iso/</code>. This allows client access via FTP without any FTP server customizations, but also HTTP by way of symbolic links and NFS with basic configuration.</li><li>The export location also takes into consideration the fact that many people put /var/ on its own partition. A mirror will require decent amount of space, and this allows it to be separate from the rest of the file system.</li><li>If you want your mirror available via FTP, HTTP and NFS you&#8217;ll need to install the <code>vsftpd</code> and <code>httpd</code> packages.</li><li>Steps 3 and 4 are only required if you plan on mirroring Red Hat Network errarta. <strong>This requires a valid RHN account and available entitlement!</strong></li><li>The <a title="mrepo Wiki page" href="http://wiki.zelut.org/doku.php/tech:mrepo">mrepo wiki page</a> on my personal wiki is available to the public for additional reference and discussion.</li></ol><p>With those details out of the way let&#8217;s get started!</p><p><strong>Step 1: Build and Install The Package</strong></p><p>The latest codebase for mrepo is not available in package format (at least that I was able to find), so we&#8217;ll have to build the package from svn. I have done this a few times and it is very painless. Simply follow the below commands and you&#8217;ll end up with an installed mrepo RPM.</p><blockquote><p><code> mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}<br /> svn co http://svn.rpmforge.net/svn/trunk/tools/mrepo/ ~/mrepo-0.8.6svn/<br /> tar cjvf ~/rpmbuild/SOURCES/mrepo-0.8.6svn.tar.bz2 ~/mrepo-0.8.6svn/<br /> echo "%_topdir ~/rpmbuild/" &gt; ~/.rpmmacros<br /> cd ~/mrepo-0.8.6svn/<br /> rpmbuild -ba mrepo.spec<br /> yum localinstall ~/rpmbuild/RPMS/noarch/mrepo-0.8.6svn*.noarch.rpm</code></p></blockquote><p>If everything goes according to plan you should end up with an <code>mrepo-0.8.6svn*.noarch.rpm</code> in your <code>~/rpmbuild/RPMS</code> directory, and it should also be installed. If you don&#8217;t have these, or you ran into other problems leave a comment and we&#8217;ll see what we can figure out.</p><p><strong>Step 2: Create The Public Directory Structure</strong></p><p>I&#8217;m guessing the reason that you want to create and export an RPM repository is that you want to share packages with others, or perhaps you want the ability to do network-based installations. This means you&#8217;ll want to make this content public. You can choose a different location for your export if you&#8217;d like, but I prefer to put my content in <code>/var/ftp/pub/</code>, so here are the directories I&#8217;d create if I wanted to make available a CentOS, Red Hat Enterprise and Fedora repository, including the latest version and both major architectures.</p><blockquote><p><code> mkdir -p /var/ftp/pub/.iso/{rhel,centos}5-{i386,x86_64}<br /> mkdir -p /var/ftp/pub/.iso/fedora11-{i386,x86_64}</code></p></blockquote><p><strong>Step 3: Generate System ID For Use With RHN (Optional)</strong></p><p>If you&#8217;re going to be exporting Red Hat Enterprise images and packages you&#8217;re going to need to generate a System ID for each release and architecture you want to gather updates for. This will allow your machine (even a non-Red Hat Enterprise machine) to connect to and gather updates from the Red Hat Network. <em>Note: This does require a valid RHN username, password and entitlement!</em></p><blockquote><p><code> gensystemid -u RHN_USERNAME -p RHN_PASSWORD --release=5Server --arch=i386 /var/ftp/pub/.iso/rhel5-i386<br /> gensystemid -u RHN_USERNAME -p RHN_PASSWORD --release=5Server --arch=x86_64 /var/ftp/pub/.iso/rhel5-x86_64<br /> </code></p></blockquote><p><em>Note: Be sure to change the paths above to match your own if you did not follow step two exactly.</em></p><p><strong>Step 4: Minor Tweaks Needed if Run On CentOS (Optional)</strong></p><p>I have found there are a few minor things that need to happen in order for a CentOS based machine to mirror updates from the Red Hat Network. They are fairly simple, but are required in order for the CentOS machine to properly and securely connect to the Red Hat Network. <em>Note: If you are not planning on mirroring Red Hat Enterprise packages you can skip this step.</em></p><blockquote><p><code>echo "up2date default" &gt;&gt; /etc/sysconfig/rhn/sources<br /> echo "uuid[comment]=Universally Unique Identifier for this server" &gt;&gt; /etc/sysconfig/rhn/up2date-uuid<br /> echo "rhnuuid=$(uuidgen)" &gt;&gt; /etc/sysconfig/rhn/up2date-uuid<br /> mkdir /usr/share/rhn<br /> cp RHN-CA-CERT /usr/share/rhn/</code></p></blockquote><p><em>Note: The last command will not work out-of-the-box because the <code>RHN-CA-CERT</code> file is not found by default on a CentOS machine. You will need to copy this from a Red Hat Enterprise machine (located in <code>/usr/share/rhn/RHN-CA-CERT</code>) and place it on your CentOS machine.</em></p><p><strong>Step 5: Download The .iso Images</strong></p><p>We&#8217;re now ready to download and install images we&#8217;re going to want to export and use. Below are a few example commands for CentOS and Fedora. After these are downloaded be sure to place them in their appropriate directory, located in <code>/var/ftp/pub/.iso/.</code> The full path should match that found in step 6 below for &#8220;iso=&#8221;</p><p><strong>CentOS 5.3</strong>:</p><blockquote><p><code>wget -c http://mirrors.kernel.org/centos/5.3/isos/i386/CentOS-5.3-i386-bin-DVD.iso<br /> wget -c http://mirrors.kernel.org/centos/5.3/isos/x86_64/CentOS-5.3-x86_64-bin-DVD.iso<br /> </code></p></blockquote><p><strong>Fedora 11</strong>:</p><blockquote><p><code> wget -c http://mirrors.kernel.org/fedora/releases/11/Fedora/i386/iso/Fedora-11-i386-DVD.iso<br /> wget -c http://mirrors.kernel.org/fedora/releases/11/Fedora/x86_64/iso/Fedora-11-x86_64-DVD.iso</code></p></blockquote><p>Your milage may vary with those mirrors, but the basic idea is to download (or if you already have downloaded, copy) the DVD images and place them into your previously created export directory of /var/ftp/pub/.iso/{$distro$releasever-$basearch}.</p><p><strong>Step 6: Create The Config File</strong></p><p>We&#8217;re almost done! I hope you&#8217;ve stayed with me so far. The last thing we need to do before we can start downloading our updates is create the configuration file. This file will detail three main things:</p><ol><li>Where are the DVD images we want to export?</li><li>Where do we want to export them?</li><li>What mirror(s) do we want to pull our updates/errata from?</li></ol><p>Once we&#8217;ve defined these items we&#8217;ll be ready to kick off mrepo and populate our mirror.</p><p>The mrepo package that we built earlier should come with a default config file. To make things simple we&#8217;ll just customize the existing file and then we&#8217;ll be ready to go. The config file can be found at /etc/mrepo.conf, and here is an example config with entries for CentOS, Fedora and Red Hat Enterprise:</p><blockquote><p><code> [main]<br /> srcdir = /var/ftp/pub/.iso<br /> wwwdir = /var/ftp/pub<br /> confdir = /etc/mrepo.conf.d<br /> arch = i386 x86_64<br /> mailto = root@localhost<br /> smtp-server = localhost<br /> rhnlogin = username:password</code></p><p><code>[centos5-i386]<br /> name = CentOS $release ($arch)<br /> release = 5.3<br /> arch = i386<br /> iso = /var/ftp/pub/.iso/centos5-i386/CentOS-$release-$arch-bin-DVD.iso<br /> updates = rsync://mirrors.kernel.org/centos/$release/updates/i386/</code></p><p><code> </code><code>## centos 5 x86_64<br /> [centos5-x86_64]<br /> name = CentOS $release ($arch)<br /> release = 5.3<br /> arch = x86_64<br /> iso = /var/ftp/pub/.iso/centos5-x86_64/CentOS-$release-$arch-bin-DVD.iso<br /> updates = rsync://mirrors.kernel.org/centos/$release/updates/x86_64/</code></p><p><code>## rhel 5 i386<br /> [rhel5-i386]<br /> name = Red Hat $release Server ($arch)<br /> release = 5.3<br /> arch = i386<br /> iso = /var/ftp/pub/.iso/rhel5-i386/rhel-$release-server-$arch-dvd.iso<br /> updates = rhns:///rhel-$arch-server-5</code></p><p><code> </code><code>## rhel 5 x86_64<br /> [rhel5-x86_64]<br /> name = Red Hat $release Server ($arch)<br /> release = 5.3<br /> arch = x86_64<br /> iso = /var/ftp/pub/.iso/rhel5-x86_64/rhel-$release-server-$arch-dvd.iso<br /> updates = rhns:///rhel-$arch-server-5</code></p><p><code>## fedora 11 i386<br /> [fedora11-i386]<br /> name = Fedora $release ($arch)<br /> release = 11<br /> arch = i386<br /> iso = /var/ftp/pub/.iso/fedora11-i386/Fedora-$release-$arch-DVD.iso<br /> updates = rsync://mirrors.kernel.org/fedora/updates/$release/$arch/</code></p><p><code> </code><code>## fedora 11 x86_64<br /> [fedora11-x86_64]<br /> name = Fedora $release ($arch)<br /> release = 11<br /> arch = x86_64<br /> iso = /var/ftp/pub/.iso/fedora11-x86_64/Fedora-$release-$arch-DVD.iso<br /> updates = http://mirrors.kernel.org/fedora/updates/$release/$arch/</code></p></blockquote><p>Once you have made the needed changes to your configuration you&#8217;re ready to kick off the mirror and export process. Based on what we have in the configuration the next step will do the following:</p><ul><li>Loop-Mount and export the DVD images to <code>/var/ftp/pub/</code>. It will create subdirectories using the bracketed title we used in the config file (ie; <code>/var/ftp/pub/fedora11-x86_64/</code>)</li><li>Mirror the public updates contents locally from the locations defined by &#8220;updates =&#8221;</li><li>Create two subdirectories within our wwwdir path for <code>RPMS.os</code> and <code>RPMS.updates</code>.</li></ul><p><strong>Step 7: Create The Repositories</strong></p><p>If you&#8217;ve made it through each of the previous steps without hitting any roadblocks you&#8217;re now ready to initiate your mirror creation.</p><blockquote><p><code>mrepo -guvvv</code></p></blockquote><p><em>Note: The command above suggests very verbose output (</em><code><em>vvv</em></code><em>) for the first run. This way you can see what it is doing and the progress it is making. For future runs you can omit the verbose options.</em></p> ]]></content:encoded> <wfw:commentRss>http://blog.zelut.org/2009/06/12/mrepo-rpm-repository-mirroring/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How To Configure PXE Boot on CentOS 5</title><link>http://blog.zelut.org/2009/03/21/how-to-configure-pxe-boot-on-centos-5/</link> <comments>http://blog.zelut.org/2009/03/21/how-to-configure-pxe-boot-on-centos-5/#comments</comments> <pubDate>Sat, 21 Mar 2009 16:55:09 +0000</pubDate> <dc:creator>Christer</dc:creator> <category><![CDATA[Automation]]></category> <category><![CDATA[CentOS]]></category> <category><![CDATA[dban]]></category> <category><![CDATA[pxe]]></category><guid isPermaLink="false">http://blog.zelut.org/?p=95</guid> <description><![CDATA[The other day I blogged about how to extract the kernel and ramdisk from the DBAN downloadable image.  These two files would be useful in the situation where you might want to PXE (network) boot a machine and have it wiped.  (Something like this may be common prior to dispositioning a machine at work, or [...]]]></description> <content:encoded><![CDATA[<p>The other day I blogged about how to extract the kernel and ramdisk from the DBAN downloadable image.  These two files would be useful in the situation where you might want to PXE (network) boot a machine and have it wiped.  (Something like this may be common prior to dispositioning a machine at work, or before you give an old machine away.)  Whatever your reasons might be, I thought I would outline the steps that I have taken to install and configure PXE on a CentOS 5 installation.</p><p><strong>Installation</strong></p><blockquote><p><code>yum install tftp-server</code></p></blockquote><p><strong>DBAN Configuration</strong></p><p>After following my previous instructions on <a title="extract DBAN PXE image" href="http://blog.zelut.org/2009/03/08/dban-via-pxe-automagically-wipe-a-drive-via-network-boot/" target="_blank">how to extract the DBAN PXE images</a>, copy the two files (kernel.bzi and initrd.gz) to the /tftpboot/ directory.</p><blockquote><p><code>mkdir -p /tftpboot/dban<br /> cp kernel.bzi /tftpboot/<br /> cp initrd.gz /tftpboot/<br /> </code></p></blockquote><p><strong>PXE Configuration</strong></p><p>You&#8217;ll also need to configure the PXE system to know what to launch/run when a specific command is given at boot.  In this case we&#8217;ll only have the DBAN option, which we could run by using the &#8216;dban&#8217; command:</p><p><code>/tftpboot/pxelinux.cfg/default</code></p><blockquote><p>display msgs/boot.msg<br /> prompt 1<br /> ## dban<br /> label dban<br /> kernel dban/kernel.bzi<br /> append load_ramdisk=1 initrd=dban/initrd.gz root=/dev/ram0 init=/rc quiet nuke=&#8221;dwipe&#8221; &#8211;autonuke &#8211;method dodshort&#8221;</p></blockquote><p>The first line in that file, &#8220;display&#8221; tells it to display a file as a menu prompt at boot time.  The second step in this section is creating that menu prompt:</p><p><code>/tftpboot/msgs/boot.msg</code></p><blockquote><p>**WARNING** TYPE &#8216;dban&#8217; TO AUTO-WIPE THE PXE BOOTED MACHINE.  **WARNING**</p></blockquote><p><strong>Start The Service</strong></p><p>Now that we have everything configured we&#8217;ll go ahead and start the service:</p><blockquote><p><code>service xinetd restart</code></p></blockquote> ]]></content:encoded> <wfw:commentRss>http://blog.zelut.org/2009/03/21/how-to-configure-pxe-boot-on-centos-5/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 7/14 queries in 0.052 seconds using disk

Served from: blog.zelut.org @ 2010-07-31 19:08:01 -->