<?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>Slashzerø &#187; Linux</title>
	<atom:link href="http://www.slashzero.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slashzero.com</link>
	<description>Random and Useless Thoughts on Everything</description>
	<lastBuildDate>Wed, 31 Mar 2010 20:46:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Shell session logging</title>
		<link>http://www.slashzero.com/2009/11/shell-session-logging/</link>
		<comments>http://www.slashzero.com/2009/11/shell-session-logging/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 00:48:14 +0000</pubDate>
		<dc:creator>abx21</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[audting]]></category>
		<category><![CDATA[pam]]></category>

		<guid isPermaLink="false">http://www.slashzero.com/?p=117</guid>
		<description><![CDATA[pam_tty_audit.so How come no one ever told me about this!  A while ago we were tasked to find a way to log all commands executed by root.  I know bash_history is easily manipulated so I spent some time on google trying to find a logging shell, then got distracted by something shiny and forgot all <a href='http://www.slashzero.com/2009/11/shell-session-logging/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><strong>pam_tty_audit.so</strong></p>
<p>How come no one ever told me about this!  A while ago we were tasked to find a way to log all commands executed by root.  I know bash_history is easily manipulated so I spent some time on google trying to find a logging shell, then got distracted by something shiny and forgot all about this task.  Turns out the linux auditing system has a built-in tty logging accounting module that will log all tty sessions!  Just add this to your pam stack (/etc/pam.d/system-auth on redhat and clones):</p>
<pre>session required pam_tty_audit.so disable=* enable=root</pre>
<p>Then run a few commands as root, and the aureport command will become your friend:</p>
<pre>audit]# aureport --tty -ts today</pre>
<pre>TTY Report
===============================================
# date time event auid term sess comm data
===============================================
1. 11/22/2009 00:07:52 132278 1040 ? 4294962295 bash "hello world",&lt;ret&gt;</pre>
<p>UPDATE:</p>
<p>You need a newer version of the audit rpm package, tty info will be collected but aureport does not know how to display them.</p>
<p><a href="https://bugzilla.redhat.com/show_bug.cgi?id=497518">https://bugzilla.redhat.com/show_bug.cgi?id=497518</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2009%2F11%2Fshell-session-logging%2F&amp;linkname=Shell%20session%20logging"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2009/11/shell-session-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux commands I can&#8217;t live without: screen</title>
		<link>http://www.slashzero.com/2008/08/linux-command-i-cant-live-without-screen/</link>
		<comments>http://www.slashzero.com/2008/08/linux-command-i-cant-live-without-screen/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 17:48:23 +0000</pubDate>
		<dc:creator>abx21</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[console server]]></category>

		<guid isPermaLink="false">http://www.slashzero.com/?p=87</guid>
		<description><![CDATA[I don&#8217;t immagine that Screen needs a big introduction.  For those that don&#8217;t know, screen is a window-manager.  One might ask I use XTerm or Konsole or Terminal in gnome, what do I use this for???  Well one of the big features of screen is that you can detach you session from you current console, <a href='http://www.slashzero.com/2008/08/linux-command-i-cant-live-without-screen/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t immagine that <a href=http://www.gnu.org/software/screen/> Screen </a> needs a big introduction.  For those that don&#8217;t know, screen is a window-manager.  One might ask I use XTerm or Konsole or Terminal in gnome, what do I use this for???  Well one of the big features of screen is that you can detach you session from you current console, go to a different computer, and reconnect to the same screen session.   You can start a command process at work, drive home, and reconnect to the still running window.</p>
<p>To start a new screen session just type &#8220;screen&#8221;.  You will see a welcome screen, just start typing away as if you are in a regular terminal session.  Need a new window? &#8220;CTRL-A c&#8221; will create one.  &#8220;CTRL-A p&#8221; goes to your previous screen, &#8220;CTRL-A n&#8221; goes to your next screen.  When you get to the last screen it just goest back to the first one.</p>
<p>So now you are ready to detach, &#8220;CTRL-d&#8221; detaches.  When you want to reconnect, I usually do a &#8220;screen -dr&#8221;, the d will detach the screen session if I had forgotten to before exiting then connect.</p>
<p>One feature I use a lot, especially when working with network gear, is the screenloging.  I connect to my router, type &#8220;CTRL-A H&#8221; to create a logfile, anything on the screen after that will get logged to the screenlog file.  Then if I do a &#8220;show run&#8221; my router config is saved incase I mess things up.</p>
<p>One final usage of screen that I empoy is as a serial interface, I connect my routers via serial to my linux laptop, then fire up screen like this &#8220;screen 9600 /dev/ttyS0&#8243; and voila.  Buy a bunch of usb serial dongles and build your own Serial Console server this way.  Turn on screenlogging and you can capture router error messages ghetto style.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2008%2F08%2Flinux-command-i-cant-live-without-screen%2F&amp;linkname=Linux%20commands%20I%20can%26%238217%3Bt%20live%20without%3A%20screen"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2008/08/linux-command-i-cant-live-without-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESXi&#8230; EPIC FAIL!!!</title>
		<link>http://www.slashzero.com/2008/08/esxi-epic-fail/</link>
		<comments>http://www.slashzero.com/2008/08/esxi-epic-fail/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 13:36:51 +0000</pubDate>
		<dc:creator>abx21</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[esx vmware fail]]></category>

		<guid isPermaLink="false">http://www.slashzero.com/?p=70</guid>
		<description><![CDATA[&#8220;This product has expired, Be sure that your host machine&#8217;s date and time are set correctly.&#8221; Way to go, I had to set the clock back to last week on my ESXi console. There goes my VMWare consolidation proposal at work. I wouldn&#8217;t want to be the poor developer that forgot to take out the <a href='http://www.slashzero.com/2008/08/esxi-epic-fail/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>&#8220;This product has expired, Be sure that your host machine&#8217;s date and time are set correctly.&#8221;</p>
<p>Way to go, I had to set the clock back to last week on my ESXi console.  There goes my VMWare consolidation proposal at work.</p>
<p>I wouldn&#8217;t want to be the poor developer that forgot to take out the &#8220;if date = august 12 2008 then fail&#8221; line of code.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2008%2F08%2Fesxi-epic-fail%2F&amp;linkname=ESXi%26%238230%3B%20EPIC%20FAIL%21%21%21"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2008/08/esxi-epic-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yet another useful Linux Command</title>
		<link>http://www.slashzero.com/2008/08/yet-another-usefull-linux-command/</link>
		<comments>http://www.slashzero.com/2008/08/yet-another-usefull-linux-command/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 15:04:32 +0000</pubDate>
		<dc:creator>abx21</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux ssh cssh]]></category>

		<guid isPermaLink="false">http://www.slashzero.com/?p=44</guid>
		<description><![CDATA[Ever had to run a command on 30 servers at once and are too lazy to write a for loop at the command prompt?  Try Cluster SSH.  What this tool does is open up an xterm to each server specified on the command line and sends what you type to all screens.  It can be <a href='http://www.slashzero.com/2008/08/yet-another-usefull-linux-command/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Ever had to run a command on 30 servers at once and are too lazy to write a for loop at the command prompt?  Try <a href="http://clusterssh.wiki.sourceforge.net/Main+Page">Cluster SSH</a>.  What this tool does is open up an xterm to each server specified on the command line and sends what you type to all screens.  It can be a lifesaver sometimes, even if it is no replacement to Cfengine or Puppet or another configuration management solution.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2008%2F08%2Fyet-another-usefull-linux-command%2F&amp;linkname=Yet%20another%20useful%20Linux%20Command"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2008/08/yet-another-usefull-linux-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux commands I never knew existed: Pipe Viewer</title>
		<link>http://www.slashzero.com/2008/07/linux-commands-i-never-knew-existed-pipe-viewer/</link>
		<comments>http://www.slashzero.com/2008/07/linux-commands-i-never-knew-existed-pipe-viewer/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 17:33:22 +0000</pubDate>
		<dc:creator>abx21</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Commands]]></category>

		<guid isPermaLink="false">http://blog.slashzero.com/?p=37</guid>
		<description><![CDATA[I have been using linux since about 1995, and it still surprises me how creative the people who contribute code and work on projects are.   The other day I had to image a bunch of machines, they all needed to be 100% identical, so I figured I would just use &#8220;dd&#8221; and send to output <a href='http://www.slashzero.com/2008/07/linux-commands-i-never-knew-existed-pipe-viewer/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I have been using linux since about 1995, and it still surprises me how creative the people who contribute code and work on projects are.   The other day I had to image a bunch of machines, they all needed to be 100% identical, so I figured I would just use &#8220;dd&#8221; and send to output over to each slave machine using netcat.  For anyone who has ever done this before, it can be a bit hard to figure out how fast data is being sent over to the system being imaged.  This is where <a href="http://www.ivarch.com/programs/pv.shtml">Pipe Viewer</a> came in handy.  Quite simply this app reports the bitrate that the data is sent over a unix pipe.  Brilliant.</p>
<p>It is not installed by default in debian, so the following will install the app.</p>
<p><code><br />
user@slashzero-desktop:~$ sudo aptitude install pv<br />
</code></p>
<p>Once installed, passing the &#8220;&#8211;help&#8221; parameter will list the basic options.</p>
<p><code><br />
user@slashzero-desktop:~$ pv --help<br />
Usage: pv [OPTION] [FILE]...<br />
Concatenate FILE(s), or standard input, to standard output,<br />
with monitoring.<br />
-p, --progress           show progress bar<br />
-t, --timer              show elapsed time<br />
-e, --eta                show estimated time of arrival (completion)<br />
-r, --rate               show data transfer rate counter<br />
-b, --bytes              show number of bytes transferred<br />
-f, --force              output even if standard error is not a terminal<br />
-n, --numeric            output percentages, not visual information<br />
-q, --quiet              do not output any transfer information at all<br />
-c, --cursor             use cursor positioning escape sequences<br />
-W, --wait               display nothing until first byte transferred<br />
-s, --size SIZE          set estimated data size to SIZE bytes<br />
-l, --line-mode          count lines instead of bytes<br />
-i, --interval SEC       update every SEC seconds<br />
-w, --width WIDTH        assume terminal is WIDTH characters wide<br />
-H, --height HEIGHT      assume terminal is HEIGHT rows high<br />
-N, --name NAME          prefix visual information with NAME<br />
-L, --rate-limit RATE    limit transfer to RATE bytes per second<br />
-B, --buffer-size BYTES  use a buffer size of BYTES<br />
-R, --remote PID         update settings of process PID<br />
-h, --help               show this help and exit<br />
-V, --version            show version information and exit<br />
Please report any bugs to Andrew Wood .<br />
</code></p>
<p>And here is a quick example, this command tar&#8217;s up a directory and send the output to gzip, showing a rate of 223MB/s:</p>
<p><code><br />
user@slashzero-desktop:/home$ tar zcf - user | pv /bin/gzip &gt; /tmp/backup.tar.gz<br />
59.7kB 0:00:00 [ 223MB/s] [===========================================&gt;] 100%<br />
</code></p>
<p>Incredibly useful stuff.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2008%2F07%2Flinux-commands-i-never-knew-existed-pipe-viewer%2F&amp;linkname=Linux%20commands%20I%20never%20knew%20existed%3A%20Pipe%20Viewer"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2008/07/linux-commands-i-never-knew-existed-pipe-viewer/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>You learn something new everyday</title>
		<link>http://www.slashzero.com/2008/07/you-learn-something-new-everyday/</link>
		<comments>http://www.slashzero.com/2008/07/you-learn-something-new-everyday/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 16:46:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[scp ssh linux hacks]]></category>

		<guid isPermaLink="false">http://blog.slashzero.com/?p=8</guid>
		<description><![CDATA[I recently was in a situation where I wanted to copy a file from one server to another.  The problem was that these two servers could not directly connect to each other, the one server that could talk to both endpoints did not have enough diskspace, and the only port open was ssh.  A collegue <a href='http://www.slashzero.com/2008/07/you-learn-something-new-everyday/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I recently was in a situation where I wanted to copy a file from one server to another.  The problem was that these two servers could not directly connect to each other, the one server that could talk to both endpoints did not have enough diskspace, and the only port open was ssh.  A collegue dropped a bit of knowledge on me.  Both endpoints of an scp command can be remote.  Who knew so this command from server B:</p>
<p><code>serverB:/ scp user@serverA:/file user@serverC:/file</code></p>
<p>Actually works.  I love linux.  It&#8217;s awesome</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.slashzero.com%2F2008%2F07%2Fyou-learn-something-new-everyday%2F&amp;linkname=You%20learn%20something%20new%20everyday"><img src="http://www.slashzero.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.slashzero.com/2008/07/you-learn-something-new-everyday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
