<?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"
	>

<channel>
	<title>BOFH Hunter</title>
	<atom:link href="http://www.bofh-hunter.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bofh-hunter.com</link>
	<description>Admin Spotting for Fun and Profit</description>
	<pubDate>Mon, 21 Jul 2008 10:56:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Spacewalk&#8217;s first steps</title>
		<link>http://www.bofh-hunter.com/2008/07/10/spacewalks-first-steps/</link>
		<comments>http://www.bofh-hunter.com/2008/07/10/spacewalks-first-steps/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 15:12:50 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[RHEL]]></category>

		<category><![CDATA[SpaceWalk]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=33</guid>
		<description><![CDATA[A few days ago RedHat announced that they had open-sourced their satellite product under the moniker of Spacewalk, and I&#8217;ve taken a few days to play around with it and get some first impressions of what&#8217;s been put out. I do not by any means claim to be an expert on the RHN satellite from [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago RedHat announced that they had open-sourced their satellite product under the moniker of <a href="http://www.redhat.com/spacewalk/">Spacewalk</a>, and I&#8217;ve taken a few days to play around with it and get some first impressions of what&#8217;s been put out. I do not by any means claim to be an expert on the RHN satellite from whence this came, or the current spacewalk incarnation. This is simply meant to be a linux enthusiast&#8217;s first look at the product they&#8217;ve put out.</p>
<p>The directions to install spacewalk are very clear and relatively simple to follow. It only took about 10 minutes to get it up and running. From there, it&#8217;s a whole different story.</p>
<h3>Spacewalk requires its own machine</h3>
<p>The directions don&#8217;t say this, and it&#8217;s not really 100% true, but for nearly all real-world cases, it&#8217;s much simpler just to give it a box. There are two basic reasons for this. First up is that spacewalk drops a number of packages on top of other things you may be running, like apache. The spacewalk server setup drops in a &#8217;satellite-httpd&#8217; process instead of using the distro provided httpd package. Since RHN satellite was/is a boxed solution, this fact can be overlooked as I figure it&#8217;s probably something that will change as the project matures and gains popularity. The second issue with spacewalk is storage, which is primarily an organization based issue. Sure it&#8217;s going to take a few gigs of disk space to mirror your favorite distribution, updates and any associated 3rd party repositories that you might want. However:</p>
<h3>Channels cannot cross organisations</h3>
<p>This one kind of surprised me considering that RHN seems to do this just fine, though it&#8217;s probably due to a different back end.  To illustrate this point a little, lets assume that we&#8217;re running the Spacewalk server for a university.  The IT department has their own organization for the university infrastructure, with a CentOS5 channel for base, a child channel for updates, and another child for Extras. A fairly boring example to be sure, but a good foundation to work from. The CS department runs CentOS for this systems as well, using it for both instruction, and the servers related to instruction. They have require the exact same channels the IT department uses, but Spacewalk currently requires them to duplicate the entire tree; Base, Updates, Extras, all of it.  If you expand this out for a few more organizations, and figure 20G or so per channel for the life of the distribution, you&#8217;re very easily looking at a few hundred gigs of storage. And while you&#8217;re busy pushing these packages to the Spacewalk server, you&#8217;ll be doing so manually. </p>
<h3>Syncing Repositories</h3>
<p>Part of the RHN satellite feature was that it would sync with redhat&#8217;s RHN proper, and then you could move out with your updates locally. The old RHN satellite would pull from RedHat&#8217;s RHN proper, and then you could manage your machines locally. With Spacewalk, the RHN sync capability was removed, and no base for syncing to other repositories (via yum, rsync or otherwise) currently exists. If you want to keep spacewalk updated with the latest and greatest for your distribution, you&#8217;ll have to script something up yourself. The methods for doing so are not difficult, and anyone with a basic grasp of shell scripting should be able to pull this off.</p>
<h3>The good stuff</h3>
<p>I really don&#8217;t want this to seem like I&#8217;m simply complaining about Spacewalk as it is a very good product, and RedHat did a good thing by releasing it. It simply has a bit of growing to do as it begins life as an open source project. There&#8217;s already a rather vibrant community springing up around it, both as a mailing list and in irc on freenode. Additionally, Spacewalk provides functional centralized management of multiple boxes across different distributions which is indeed quite useful. </p>
<p>If you&#8217;re in the market for centralized system management and you have a box with storage to spare, then I would highly recommend folks take a look at Spacewalk.  It is definitely a project to keep an eye on as it matures.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/07/10/spacewalks-first-steps/feed/</wfw:commentRss>
		</item>
		<item>
		<title>3ware performance in CentOS</title>
		<link>http://www.bofh-hunter.com/2008/06/13/3ware-performance-in-centos/</link>
		<comments>http://www.bofh-hunter.com/2008/06/13/3ware-performance-in-centos/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 13:54:35 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[3ware]]></category>

		<category><![CDATA[aacraid]]></category>

		<category><![CDATA[CentOS]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=32</guid>
		<description><![CDATA[There is an upstream bug report here, which may be of interest to folks using 3ware and aacraid raid cards  with CentOS or RHEL. The basics of the bug hinge on setting MWI, which can have a pretty hefty impact on IO performance.  If you&#8217;re storing your MySQL bits on a 3ware powered [...]]]></description>
			<content:encoded><![CDATA[<p>There is an upstream <a title="3ware bugzilla report" href="https://bugzilla.redhat.com/show_bug.cgi?id=444759">bug report </a><a title="3ware performance bug" href="https://bugzilla.redhat.com/show_bug.cgi?id=444759">here,</a> which may be of interest to folks using 3ware and aacraid raid cards  with CentOS or RHEL. The basics of the bug hinge on setting MWI, which can have a pretty hefty impact on IO performance.  If you&#8217;re storing your MySQL bits on a 3ware powered array, it&#8217;s a safe bet that this fix may help improve your performance and reduce some of the IO wait seen on the system.</p>
<p>The downside with this is that even though the fix is known, Red Hat is sticking to their procedure, and has stated that they will not release the fix for this in the main kernel until 5.3 is released. Since 5.2 is fresh from the factory, it&#8217;s not likely that we&#8217;ll be seeing this fix pushed mainstream in the next few months.</p>
<p>This leaves a few choices for the RHEL and CentOS communities for how to proceed.</p>
<ol>
<li>Weigh in with your opinion on this bug report. If enough people respond, RH will likely appease them.</li>
<li>Help test the patched kernels in the bug report.  The more comfortable RH is with the patch, the more likely it is that they&#8217;ll tuck it in with a bug fix or security update.  See #1.</li>
<li>Give CentOS a chance to get 5.2 out the door. Once it&#8217;s released, folks will have some time to roll up a kernel repository at http://people.centos.org  similar to what was done with <a title="modified kernels" href="http://people.centos.org/tru/kernel+bz321111/">bz321111</a>.  Since this bug is strictly performance affecting, installs won&#8217;t be an issue, and you can update to the modified kernel, or use the stock release as you see fit.</li>
</ol>
<p>In theory, you could also roll your own kernel with this patch if you didn&#8217;t want to wait, however if you do this, you&#8217;re accepting responsibility for building it properly and tracking all the kernel security and bug updates until the patch becomes mainstream. I wouldn&#8217;t recommend this method since it requires more time and upkeep, but for folks who roll their own it provides another alternative.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/06/13/3ware-performance-in-centos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>gconf voodoo</title>
		<link>http://www.bofh-hunter.com/2008/06/05/gconf-voodoo/</link>
		<comments>http://www.bofh-hunter.com/2008/06/05/gconf-voodoo/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 03:01:50 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=30</guid>
		<description><![CDATA[The gnome desktop has tons of versatility and flexibility to suit just about any desktop type needs. Unfortunately this flexibility has a hidden cost, and a few dozen hidden options.  While most options are right where you&#8217;d expect them to be in the various gnome applications like nautilus, others can be difficult to nail [...]]]></description>
			<content:encoded><![CDATA[<p>The gnome desktop has tons of versatility and flexibility to suit just about any desktop type needs. Unfortunately this flexibility has a hidden cost, and a few dozen hidden options.  While most options are right where you&#8217;d expect them to be in the various gnome applications like nautilus, others can be difficult to nail down. This is where gconf was supposed to come to our rescue, but instead it got all drunk and confused.</p>
<p>While many folks compare it to the Windows registry, this isn&#8217;t entirely accurate. GConf is a bit more user friendly than that, although some similarities can be drawn. It&#8217;s a binary set of files which requires a special utility to work, and operates in a directory/file structure type.  Below, we&#8217;ll go through some of the more common changes users are likely to want.</p>
<h3>The Basics:</h3>
<p>There are two ways to go about playing around in your GConf registry. You can use the gconf-editor gui, which is in the gconf-editor package, or you can use gconftool-2, which is a command line driven application, and a little more cumbersome to maneuver around in. The basic command to help get you around in gconftool-2 is <em>&#8216;gconftool-2 -R /&#8217;</em>. With this command, you&#8217;ll see the directory/file structure which makes up the registry, and their associated settings. If you&#8217;re new to gconf, it&#8217;s probably best to start out with the gui.</p>
<h3>Starting small:</h3>
<p>A few times a month or so, users will ask how to tell gnome or nautilus to ignore blank CD input, or to at least do something useful with it, like open k3b instead of the default nautilus burn window.  Setting this up with gconf-editor is relatively simple. Open it up, and browse to the <em>&#8216;/desktop/gnome/volume_manager/&#8217;</em> directory. Inside this directory you&#8217;ll find a number of settings that you can modify for various automated media handling. You can change the default movie player, dvd player and more from this directory. Incidentally, <em>&#8216;automount_drives&#8217;</em> and <em>&#8216;automount_media&#8217;</em> are located here also, so if you&#8217;re having trouble with usb drives, this is one thing to check.  The two options that we&#8217;re concerned with right now are <em>&#8216;autoburn_data_cd_command&#8217;</em> and <em>&#8216;autoburn_audiio_cd_command&#8217;. </em></p>
<p>By default these are both set to &#8216;<em>nautilus &#8211;nodesktop burn:</em>&#8216;, but this isn&#8217;t the behavior we want. If you&#8217;d like to have k3b loaded up instead, simply change the string values to <em>&#8216;k3b&#8217; </em>and you&#8217;re off and running. This is a per user setting, so you don&#8217;t have to be root to modify most of these values. If you do happen to launch the app with sudo, you&#8217;ll also have the ability to enforce this setting for all users. This can get handy, and we&#8217;ll look at it a bit later on.</p>
<h3>System Policies</h3>
<p>Now that you&#8217;ve had a little bit to look at the user side of gconf, if you&#8217;re planning to run lab or kiosk systems you might also want to look at enforcing some of your system policies with gconf. This should not be your only security method to lock the boxes down, simply another layer to examine for inclusion.</p>
<p>Inside the <em>/desktop/gnome/lockdown</em> directory, you&#8217;ll find several settings which can help you restrict your workstations or kiosk systems, such as <em>&#8216;disable_command_line&#8217;</em>. After launching gconf-editor with sudo, set these options the way that you want, then right click them and choose &#8216;<em>Set as Mandatory</em>&#8216;. This will enforce these changes for all system users, and disallow the user from changing the settings individually for their accounts. This can be done for many of the settings here, including application specific options. While this means of enforcement is not perfect, it can go a long way toward helping an admin regain some control and a possibly a little sanity.  It&#8217;s also one <strong>EVIL </strong>BOFH prank for other admins/users&#8230; if one were so inclined&#8230; &gt;:-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/06/05/gconf-voodoo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The kernel collection</title>
		<link>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/</link>
		<comments>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/#comments</comments>
		<pubDate>Thu, 22 May 2008 02:17:42 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=29</guid>
		<description><![CDATA[If you maintain a number of older RHEL or CentOS 3 and 4 machines, you&#8217;ve probably got a few extra kernels lying around to clutter up your /boot partition. In some instances this can cause update issues, and I ran into one such case today. An admin came to me asking why yum was attempting [...]]]></description>
			<content:encoded><![CDATA[<p>If you maintain a number of older RHEL or CentOS 3 and 4 machines, you&#8217;ve probably got a few extra kernels lying around to clutter up your /boot partition. In some instances this can cause update issues, and I ran into one such case today. An admin came to me asking why yum was attempting to install all of his packages to his /boot partition,  and when I examined further, I saw this on his screen:<br />
<code><br />
installing package kdegraphics-3.3.1-9.el4_6 needs 3MB on the /boot filesystem<br />
</code><br />
While the error itself does look at first glance as the admin described it, this is not the case. The culprit was a kernel update further up the screen, and a 98% full /boot partition, with around 25 spare kernels. His system was simply informing him that the transaction would not occur because one of the updates was not going to succeed due to limited disk space. </p>
<p>While the InstallOnlyN plugin for yum will handle this quite nicely for the day to day stuff, once it&#8217;s happened it can be a little tricky to resolve. The easiest way is with a script called <a href="http://linux.duke.edu/~skvidal/useful-scripts/kernel-prune.py">kernel-prune</a> from <a href="http://http://skvidal.wordpress.com/">Seth Vidal</a>&#8217;s duke directory. </p>
<p>By piping the output of this script through xargs, you can remove all the tedium of manually removing packages one or two at a time. For RHEL and CentOS 3, where installonlyn isn&#8217;t really an option, this is pretty much the easiest way to periodically purge some unwanted fat from your system. Hope this helps at least 1 of you out there. </p>
<p>Feel free to share your own methods or comments below. I&#8217;m sure there are other methods out there so let&#8217;s hear them!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/05/21/the-kernel-collection/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CentOS reference guide</title>
		<link>http://www.bofh-hunter.com/2008/05/19/centos-reference-guide/</link>
		<comments>http://www.bofh-hunter.com/2008/05/19/centos-reference-guide/#comments</comments>
		<pubDate>Mon, 19 May 2008 18:10:03 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[RHEL]]></category>

		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=27</guid>
		<description><![CDATA[SElinux is a phenomenal way to protect your systems, and very few people disagree with this. The biggest complaint I hear is that it&#8217;s not user friendly. Most people seem to treat it like a binary system, and either leave it on, or turn it off. There&#8217;s very little documentation about the ins and the [...]]]></description>
			<content:encoded><![CDATA[<p>SElinux is a phenomenal way to protect your systems, and very few people disagree with this. The biggest complaint I hear is that it&#8217;s not user friendly. Most people seem to treat it like a binary system, and either leave it on, or turn it off. There&#8217;s very little documentation about the ins and the outs of selinux contexts and the targeted rulesets which ship with RHEL and CentOS. After some discussions with Ralph this morning on IRC, he&#8217;s graciously put together a list of the base contexts which ship in the targeted rule, and a brief explanation of what they do. If you want to take a few minutes to look through the granular protection possible through selinux, have a quick read of the new documentation at <a title="SELinux policy explanation" href="http://wiki.centos.org/TipsAndTricks/SelinuxBooleans">http://wiki.centos.org/TipsAndTricks/SelinuxBooleans</a></p>
<p>If you&#8217;re on IRC, feel free to stop by freenode&#8217;s #centos channel and thank Range for putting this list together.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/05/19/centos-reference-guide/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Abusing MySQL</title>
		<link>http://www.bofh-hunter.com/2008/05/08/abusing-mysql/</link>
		<comments>http://www.bofh-hunter.com/2008/05/08/abusing-mysql/#comments</comments>
		<pubDate>Thu, 08 May 2008 17:21:19 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=25</guid>
		<description><![CDATA[One of the larger complaints about mysql for me has always been the hoops required to find out basic information. I want to check my GRANTS periodically to check permissions. I want backups to not take forever, and I want to be able to use find.  Turns out, I can have everything I want [...]]]></description>
			<content:encoded><![CDATA[<p>One of the larger complaints about mysql for me has always been the hoops required to find out basic information. I want to check my GRANTS periodically to check permissions. I want backups to not take forever, and I want to be able to use find.  Turns out, I can have everything I want and all I have to do is use maatkit.</p>
<p>I discovered this a few nights ago while reading through <a title="Jeremy Cole" href="http://jcole.us/blog/">Jeremy Cole&#8217;s blog</a> and noticed some of the functionality he was <a title="Proven Scaling Yum" href="http://jcole.us/blog/archives/2008/04/17/now-available-proven-scaling-mysql-yum-repository/">talking about</a>.  While I don&#8217;t fully trust their repositories (I prefer to stick with the distro mysql releases), I was very interested in the <a title="Maatkit" href="http://www.maatkit.org/">maatkit</a> functionality.</p>
<p>After talking with Karanbir and waiting patiently for a few minutes, I had a nice shiny build of the maatkit MySQL toolkit in the testing repository to play with. It works exactly as advertised, and I could not be happier with it.</p>
<p>The majority of the maatkit tools are geared toward mysql replicated environments, so there&#8217;s a load of master/slave tracking capability including some new ways to track latency, lag, and more. This is all neat, but it&#8217;s not something I&#8217;m overly interested in just yet, because I don&#8217;t have any replication problems.</p>
<p>What does interesting me is this: mk-find</p>
<p>mk-find  is essentially a perl implementation of find for mysql. I can now search for and sort tables by size, row, create/modify time,  and perform actions based on what returns with &#8211;exec.</p>
<p>Another tool within maatkit which caught my eye was mk-parallel-dump, which while exceptionally long to type in (yes, I&#8217;m lazy) is quite a good tool for speeding up backups. Instead of simply dumping the entire db all at once into a single file and waiting for it to spool through huge amounts of information, I can pass this utility a directory,  run a thread per table, and cut my backup time by a significant percentage of time. Simply run: mk-parallel-dump &#8211;tab &#8211;basedir /path/to/backups/ and you&#8217;re off, but if you want to get even more hi-tech, they include some sample scripts for scheduled backups.</p>
<p>If you&#8217;re looking for a way to make your mysql management tasks easier, have a look at maatkit, or just go get it from the CentOS-Testing repository and see how it can simplify your life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/05/08/abusing-mysql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CentOS 5 and aide</title>
		<link>http://www.bofh-hunter.com/2008/04/10/centos-5-and-aide/</link>
		<comments>http://www.bofh-hunter.com/2008/04/10/centos-5-and-aide/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 15:41:42 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[aide]]></category>

		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[tripwire]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/2007/12/04/centos-5-and-aide/</guid>
		<description><![CDATA[In recent days, the subject of intrusion detection systems for centos has come up. To cover this and hopefully help some folks out, I&#8217;ve decided to do a brief writeup of Aide, the IDS which comes with CentOS. Please don&#8217;t confuse this with SELinux. SELinux is a Mandatory Access Control style permissioning system.  SELinux [...]]]></description>
			<content:encoded><![CDATA[<p>In recent days, the subject of intrusion detection systems for centos has come up. To cover this and hopefully help some folks out, I&#8217;ve decided to do a brief writeup of Aide, the IDS which comes with CentOS. Please don&#8217;t confuse this with SELinux. SELinux is a Mandatory Access Control style permissioning system.  SELinux stops people from getting into your system via protected applications. Aide lets you know if they actually get beyond SELinux and onto your system.</p>
<p><strong>Installing  Aide</strong><br />
<code>yum install aide</code><br />
What? You expected it to be harder? Now that we have aide installed, we need to configure it. The default config file should be okay for most folks who haven&#8217;t relocated things on the distro too much. Double check to make sure that all the directories you want to scan are listed. If you want to fine-tune the aide config, then you&#8217;ll need to edit <em>/etc/aide.conf</em>.</p>
<p><strong>Initializing Aide&#8217;s Records<br />
</strong></p>
<p>The next thing we need to do is create the initial aide database. For this, you need to run the following command:<br />
<code># /usr/sbin/aide --init </code></p>
<p>This will take a little bit of time to run, and you&#8217;ll have some disk churn for minute or two while aide investigates your system and creates a baseline. Once this is done, we&#8217;re going to run an initial query of the system, just to make sure that everything&#8217;s working properly. To do this, run the command below:<br />
<code># cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz<br />
# /usr/sbin/aide --check<br />
</code></p>
<p>This copies the initial database to the current database, then checks them against each other. In theory you should not have any differences. If you do, investigate them. As we&#8217;re still setting this up, they&#8217;re likely to be mundane .viminfo files or something similar. Keep in mind that when you update applications via &#8216;yum update&#8217; that you may see aide go a bit nuts, just as tripwire or others would. You&#8217;re replacing files on your system when you update, and this is exactly what aide is designed to warn you about.  In a perfect world, you should get some output like the text below:</p>
<p><code># aide --check<br />
AIDE, version 0.13.1<br />
### All files match AIDE database. Looks okay!<br />
</code></p>
<p>Once we&#8217;re satisfied that aide is working as we expect, it&#8217;s time to set up a periodic check of the system. Only you can determine what&#8217;s often enough for your servers. I personally run aide as weekly cron, by creating a file in /etc/cron.weekly/ called aide.cron,  with the following contents:</p>
<p><code><br />
#!/bin/bash<br />
/usr/sbin/aide --check | /bin/mail -s "Weekly Aide Data" email@host.com<br />
</code><br />
This runs my check once a week. That&#8217;s pretty much it to setting up aide. If you want to see more options for aide, please check out the documentation in /usr/share/doc/aide-*/</p>
<h2><span style="color: #3366ff;">Update</span>:</h2>
<p>So it seems that  by default, aide requires selinux to be enabled, or at least permissive so that it can record the selinux contexts of the files it watches. If for some reason you really, truly want to have selinux disabled, but you still want aide to watch the system, use the config file below. It is identical to the default scan, but with the selinux bits removed.</p>
<p><a href="http://www.bofh-hunter.com/downloads/aide.conf">selinux-free.aide.conf </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/04/10/centos-5-and-aide/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ssh oneliners</title>
		<link>http://www.bofh-hunter.com/2008/04/08/ssh-oneliners/</link>
		<comments>http://www.bofh-hunter.com/2008/04/08/ssh-oneliners/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 17:22:38 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=23</guid>
		<description><![CDATA[Some handy commands to remember when you really need to abuse ssh.
ssh -X remotehost # yawn. X forwarding through ssh.
ssh -Y remotehost # trusted X forwarding through ssh. Still yawn, let&#8217;s do something fun.
ssh -D2222 remotehost # This is okay. This command sets up a SOCKS proxy on port 2222 which can be used with [...]]]></description>
			<content:encoded><![CDATA[<p>Some handy commands to remember when you really need to abuse ssh.</p>
<p><strong>ssh -X remotehost</strong> # yawn. X forwarding through ssh.</p>
<p><strong>ssh -Y remotehost</strong> # trusted X forwarding through ssh. Still yawn, let&#8217;s do something fun.</p>
<p><strong>ssh -D2222 remotehost #</strong> This is okay. This command sets up a SOCKS proxy on port 2222 which can be used with firefox (and Internet Explorer if you really hate yourself) to avoid office internet filters&#8230;. not that I condone such anti-social behavior.</p>
<p><strong>ssh -L 3306:database.example.net:3306</strong> # okay, now we&#8217;re getting interesting. This generates an ssh tunnel between your machine and the remote box on port 3306. This works for connecting to remote mysql instances when firewalls would ordinarily interfere. Simply point your mysql client to localhost:3306 and you&#8217;re off and running.  This can also be applied to other applications as well. A slight modification, and you get the string below:</p>
<p><strong>ssh -L3389:remote.win2k3.server:3389 user@remote.linux.box</strong> # This command is a variation on the command above, allowing us to connect to those unsightly windows machines via rdesktop for remote administration. Best of all, we do this without opening up the remote desktop ports to the outside world. Remember folks, that windows code is expensive, you have to keep your precious little snowflakes safe after all.</p>
<p>With the commands above, you can alternatively add -f , if you want ssh to go to the background after the authentication portion is handled. Otherwise it&#8217;ll just leave you sitting at a remote shell prompt.  If you wanted to add a built-in self-destruct, you could add &#8217;sleep 30&#8242; after the ssh command strings above. This tells ssh to exit after 30 seconds if nothing has made a connection via the tunnel created.</p>
<p><strong>ssh -nNT -R 2222:localbox:2222 remotebox</strong> # This command lets you create a <em>reverse </em> ssh tunnel, so that if you connect to remotebox:2222, you&#8217;ll be connected to the local machine on port 2222 also. This is useful when you really want to go home at night, but your boss demands you keep working. This way, you each get what you want, and you can avoid the firewall your office employs to keep folks from remotely connecting to&#8230;well, if you&#8217;re using this, you don&#8217;t really care. <img src='http://www.bofh-hunter.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p>Crap, what if I already have an ssh session open, but I forgot to create the tunnel? Not to worry, there are escape keys to rescue you. Operating a little like screen, ~C will open an ssh command prompt so that you can start or stop tunnels as needed.  It&#8217;ll look a bit like the one below:<br />
<code><br />
[jperrin@server ~]$<br />
ssh> help<br />
Commands:<br />
      -Lport:host:hostport    Request local forward<br />
      -Rport:host:hostport    Request remote forward<br />
      -KRhostport             Cancel remote forward<br />
</code></p>
<p>As always, we&#8217;re just scratching the surface of what ssh can do, so if you want more information, fire up &#8216;man ssh&#8217; in your favorite terminal and sit down for a good read.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/04/08/ssh-oneliners/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Customize SSH</title>
		<link>http://www.bofh-hunter.com/2008/04/08/customize-ssh/</link>
		<comments>http://www.bofh-hunter.com/2008/04/08/customize-ssh/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 16:04:58 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=22</guid>
		<description><![CDATA[SSH is a staple of *nix environments, however most people don&#8217;t take the time to customize it in order to take advantage of the deeper features. If you have more than a few machines to log into or administer, it&#8217;s pretty likely that you&#8217;ve also got a few usernames to go along with them.  [...]]]></description>
			<content:encoded><![CDATA[<p>SSH is a staple of *nix environments, however most people don&#8217;t take the time to customize it in order to take advantage of the deeper features. If you have more than a few machines to log into or administer, it&#8217;s pretty likely that you&#8217;ve also got a few usernames to go along with them.  By creating a personal ssh config file, you can shave a few seconds and a few keystrokes off your logins. You can even create profiles for several user accounts on the same machine if you have specific task based logins.</p>
<p>To get started with your own personal config file, create and open <em>~/.ssh/config</em> in your favorite text editor.  The easiest way to organize this file is to break it up into host based sections, similar to the example below.<br />
<code><br />
Host SessionName # Short Name you can use to start a session<br />
HostName server.example.com  # FQDN or ip of the server<br />
User myuser   # Unprivileged username for this session</code></p>
<p>Host Session2<br />
HostName server.example.com<br />
User myadminuser  #this is a 2nd user with sudo access to the same server<br />
IdentityFile    id_rsa</p>
<p>Host server2<br />
HostName server2.example.com<br />
User  yetanother   # yet another user on another host.<br />
IdentifyFile    second_rsa_key<br />
Compression yes #server has limited bandwidth, so enable compression</p>
<p>Host backup<br />
HostName  backups.example.com<br />
User   backupuser   # backup user<br />
BindAddress 192.168.1.2  #Connect from this ip address.<br />
Port  2222 # Use this port instead of 22.</p>
<p>As you can see from the example above, we change ssh keys so you don&#8217;t have to use the same one, ssh usernames to eliminate the @, and the address ssh connects from since we have multiple IP addresses on this system. This isn&#8217;t really even scratching the surface of what you can do with ssh, so  if you have even more customizations in mind, have a read through the ssh_config manpage in your favorite terminal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/04/08/customize-ssh/feed/</wfw:commentRss>
		</item>
		<item>
		<title>death to the tilde</title>
		<link>http://www.bofh-hunter.com/2008/04/03/death-to-the-tilde/</link>
		<comments>http://www.bofh-hunter.com/2008/04/03/death-to-the-tilde/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 02:08:25 +0000</pubDate>
		<dc:creator>Jim Perrin</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[httpd]]></category>

		<category><![CDATA[ReWrite]]></category>

		<guid isPermaLink="false">http://www.bofh-hunter.com/?p=21</guid>
		<description><![CDATA[Well, for the past 2 hours, I&#8217;ve been fighting with mod_rewrite to get rid of the ~ character that apache shoves into a url for the UserDir directive by default. Since having a url like http://example.com/username/foo.html is far neater than http://example.com/~username/foo.html, and mostly because hughesjr has been after me to fix it, I finally have [...]]]></description>
			<content:encoded><![CDATA[<p>Well, for the past 2 hours, I&#8217;ve been fighting with mod_rewrite to get rid of the ~ character that apache shoves into a url for the UserDir directive by default. Since having a url like http://example.com/username/foo.html is far neater than http://example.com/~username/foo.html, and mostly because hughesjr has been after me to fix it, I finally have a solution.</p>
<p>So, for those of you thinking &#8220;uh, there&#8217;s an example for doing this right in the httpd docs&#8221;&#8230; let me save you the trouble. It doesn&#8217;t work. the instructions at <a href="http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html">http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html</a> cause the url to be rewritten properly, but then promptly 404&#8217;s because it looks in /var/www/html/u/username/ for the files. Afer digging around in google, and working with some friendly folks in #apache (yes they do exist) we have a solution:<br />
<code><br />
RewriteEngine On<br />
#RewriteLog logs/rewrite.log # Uncomment for rewrite logging<br />
#RewriteLogLevel 3 # uncomment for verbose logging<br />
RewriteCond      %{REQUEST_URI} ^/([^/]+)<br />
RewriteCond /home/%1 -d<br />
RewriteRule ^/([^/]+)(.*) /home/$1/public_html/$2<br />
</code></p>
<p>Take that bit of code, and drop it into /etc/httpd/conf.d/homedir.conf or wherever else you&#8217;d like in your httpd configs, and reload apache. From there you&#8217;ll be able to use shorter, sexier UserDir urls for your user&#8217;s webpages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bofh-hunter.com/2008/04/03/death-to-the-tilde/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
