<?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/tag/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>
	</channel>
</rss>
