<?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>Daniel Hall&#039;s Website &#187; System Administration</title>
	<atom:link href="http://www.danielhall.me/category/computing/linux/system-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danielhall.me</link>
	<description>Because the Internet doesn&#039;t have enough opinions already</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:52:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Protecting Email with DKIM</title>
		<link>http://www.danielhall.me/2010/07/protecting-email-with-dkim/</link>
		<comments>http://www.danielhall.me/2010/07/protecting-email-with-dkim/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:57:19 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[System Administration]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Phishing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://www.danielhall.me/?p=629</guid>
		<description><![CDATA[<p>One of the problems with the email and the protocols used to transfer it (SMTP) is that they were designed long ago when the Internet was a much friendlier place. When SMTP was designed it was assumed that other hosts on the Internet could be trusted. This is particularly visible in the configuration of relays [...]]]></description>
			<content:encoded><![CDATA[<p>One of the problems with the email and the protocols used to transfer it (SMTP) is that they were designed long ago when the Internet was a much friendlier place. When SMTP was designed it was assumed that other hosts on the Internet could be trusted. This is particularly visible in the configuration of relays where the sender doesn&#8217;t have to be identified. A mail relay will accept mail from any server regardless of where the mail appears to be coming from.</p>
<p>To attempt to rectify this SPF was created. To setup SPF you add either a TXT or an SPF record to the DNS zone you will be sending from. This record defines which servers are allowed to send mail that is coming from that domain. So on my domain danielhall.me I could publish an SPF record that says only my mail server is allowed to send mail that ends in @danielhall.me. Any mailservers receiving mail that is from my domain but not coming from an address listed in my SPF record can see that the mail is likely forged and throw it away. SPF works well in most situations but fails at a very common use case. If someone I send mail to tries to forward it to another address using an automatic process (no clicking forward in their client) then the mail will appear to come from my domain when it gets to the user it was forwarded to, however it will have came from the original recipients mailserver.</p>
<p>DKIM solves this problem by giving each sending mailserver a cryptographic key pair. The public keys is then published in a DNS record in that zone and stores the private key somewhere safe on the server. The server then proceeds to sign the headers (especially the From: header) and the body of all outgoing emails. This signature is then attached to the email as an extra header. When the receiving server get the email it gets the signature and uses that along with the list of signed headers to verify the signature against the public key of the signing domain. This means as long as the mail has passed through an authorised mailserver at any point it will be considered valid.</p>
<p>Setting up a DKIM is relatively simple process. You will need access to the  zone records for your domain and access to the configuration of all the mailservers which all mail originating at your domain passes through. You also need to be aware that signing mail makes it slightly more processor intensive to send an email. If you send a large amount of email this difference could be quite significant. If you&#8217;re using sendmail you may be able to alleviate it by switching to a less resource hungry MTA like Exim. You should also note that in some configurations DKIM can not be setup. For example if you use masquerading in sendmail DKIM will always fail as sendmail will modify the from header after signing.</p>
<p>Ultimately DKIM is a good move for the internet community at large, especially when combined with SPF. DKIM mail is assured to come from the sender and can be cryptographically proven so. While it does take more take a little more effort to setup and maintain it assures mail from your domain is secure and can be assured to have come from you or your company. Ultimately DKIM can protect your company against phishing attempts and boost your spam scores.</p>
<p><strong>Random thought:</strong> What would Email look like if it were designed today?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielhall.me/2010/07/protecting-email-with-dkim/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SSH Agent Forwarding</title>
		<link>http://www.danielhall.me/2009/08/ssh-agent-forwarding/</link>
		<comments>http://www.danielhall.me/2009/08/ssh-agent-forwarding/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 23:01:29 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.danielhall.me/?p=160</guid>
		<description><![CDATA[<p>So you use keys to SSH between your hosts, and you either have separate keys for each machine you use, or worse you have the same key on each machine. Lets go over why each of those are bad, and lets see how SSH Agent forwarding will help with those issues and make things easier [...]]]></description>
			<content:encoded><![CDATA[<p>So you use keys to SSH between your hosts, and you either have separate keys for each machine you use, or worse you have the same key on each machine. Lets go over why each of those are bad, and lets see how SSH Agent forwarding will help with those issues and make things easier for you in general.</p>
<p>So the key part of why a SSH agent and SSH agent forwarding forwarding is so useful is due to the way keys can be attacked. If I wanted to get your SSH private key I could find some flaw in the system that would give me that /home/you/.ssh/id_rsa file you have. Of course a malicious user with root access to the system could just go in and grab it. You can prevent this kind of attack by setting a passphrase on the key. Of course the root user could replace SSH with a special version designed to get your passphrase, steal the key out of memory or setup a keylogger. This means effectively that your private key is not safe on any system where a person you don&#8217;t trust has root access, or has other users and exploitable vulnerabilities.</p>
<h2>Single Private Key on Multiple Machines</h2>
<p>In this example you&#8217;re trusting the security of every single machine you have your private key on. Should it get compromised then you have to revoke you public key from every host, and regenerate private keys to place on every host. Every time you put your private key on a machine you increase the chances that it could be compromised.</p>
<h2>Multiple Private Keys On Multiple Machines</h2>
<p>So we&#8217;re getting a little closer to a good solution. In this instance we don&#8217;t have to generate our key and roll it out to all hosts in event of a compromise. You can also have segregate groups, on set of keys for work, another for home and so on. Your keys can still be compromised easily though, and once compromised they can be used until you revoke them manually.</p>
<h2>SSH Agent Forwarding</h2>
<p>There is a way to keep your key safe from compromise. Now I&#8217;ll have to explain how SSH authenticates you using your key. When your authenticating with SSH keys your key isn&#8217;t sent, the server sends you some random data and challenges your client to encrypt it with your private key. It then verifies the encrypted data by decrypting it with the public key and checking if it matches the data originally sent. Now the way most people would SSH from the second host to another third host is to utilise a private key on the second host to connect to the third host. Unfortunately this method means that you have to store a key (that is open for compromise) on the second host. SSH agent forwarding tells the SSH client on the second server to send the challenge data through to the SSH client (or ssh agent) on the first host. The agent encrypts the data and sends it via the SSH session to the third client.</p>
<p>The beauty of this method is that the second host never sees a private key, and the challenge data is useless to try and connect to a different host. Even if the second host is compromised there isn&#8217;t a private key there to compromise. It should be noted that if the second host is compromised it can still request the agent identify for a different host, or the session to the third host can be taken over. Both these are temporary though and unless the malicious user installs their key (something easy to notice) they cannot get back in.</p>
<div id="attachment_173" class="wp-caption alignright" style="width: 160px"><a href="http://www.danielhall.me/wp-content/uploads/2009/08/SSHAgent.png"><img class="size-thumbnail wp-image-173 " title="SSHAgent" src="http://www.danielhall.me/wp-content/uploads/2009/08/SSHAgent-150x150.png" alt="Diagram detailing how an SSH connection is authenticated using agent forwarding." width="150" height="150" /></a><p class="wp-caption-text">Diagram detailing how an SSH connection is authenticated using agent forwarding.</p></div>
<p>If you want to know more about how this works, there is a wonderful tech tip at <a href="http://unixwiz.net/techtips/ssh-agent-forwarding.html">http://unixwiz.net/techtips/ssh-agent-forwarding.html</a>.</p>
<h2>But how?</h2>
<p>SSH agent forwarding is even easier than copying keys all over the place. The first step is to generate keys for all the machines you log on to directly. You need to be sure these machines are secure and that your keys will stay safe, though this is sometimes not possible. You then add the generated public key to the authorized hosts file of all the machines you will connect to from this one, including ones that take two or more steps to get to. Finally you edit your ~/.ssh/ssh_config file to tell SSH to forward your agent through those hosts. Include the intermediate hosts in this list, but not the endpoints. You could also use <a href="http://www.danielhall.me/2009/07/sshmenu/">SSHmenu</a> to add the arguments automatically to those SSH commands. The following disables forwarding to all hosts, and explicitly enables it to fred, and aaron.missgner.com.</p>
<pre>Host fred
  ForwardAgent yes

Host aaron.missgner.com
  ForwardAgent yes

Host *
  ForwardAgent no</pre>
<p><strong>Random thought: </strong>Linux has Plug &#8216;n Pray too, you plug the device in and pray the drivers aren&#8217;t proprietary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielhall.me/2009/08/ssh-agent-forwarding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SystemTap</title>
		<link>http://www.danielhall.me/2009/07/systemtap/</link>
		<comments>http://www.danielhall.me/2009/07/systemtap/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 00:10:31 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[Profiling]]></category>
		<category><![CDATA[Systemtap]]></category>

		<guid isPermaLink="false">http://www.danielhall.me/?p=32</guid>
		<description><![CDATA[<p>SystemTap is the Linux analogy to Solaris DTrace and is similar to the strace command, only much much more powerful. It effectively lets you set breakpoints in the kernel to monitor what your applications are doing. For example if I was worried that some application I&#8217;d written was polling way too often, I could ask [...]]]></description>
			<content:encoded><![CDATA[<p>SystemTap is the Linux analogy to Solaris DTrace and is similar to the strace command, only much much more powerful. It effectively lets you set breakpoints in the kernel to monitor what your applications are doing. For example if I was worried that some application I&#8217;d written was polling way too often, I could ask SystemTap to output the number of times my application calls poll() or select().</p>
<p>To use SystemTap first you write a simple script, or borrow one from someone else. On a Fedora system you&#8217;ll fine some sample scripts in /usr/share/doc/systemtap-0.9.8/examples provided you have SystemTap installed. You then run the <em>stap</em>; command. The stap command immediately begins parsing the scipt looking for any tapsets that your script uses and if it does it includes them. It then converts your script into C code and compiles it into a kernel module. This kernel module is inserted into the running kernel and stap attaches to it. The kernel module stays in the kernel until it is cancelled by the user, it reaches an exit function or it encounters too many errors.</p>
<p>While SystemTap can be used to simply dump loads of data about what an application is doing in kernel space that is not its purpose. SystemTap scripts are able to drill down, extract, process and format the data its gathering. For example if you were trying to find out what files a process was writing to your disks could just output every single write call and print it out, or you could keep the statistics and every ten seconds print the top ten files written to. SystemTap is designed to help you filter out all the noise and monitor only what you want to monitor.</p>
<p>The simple way to get started with SystemTap is to download the <a href="http://sourceware.org/systemtap/SystemTap_Beginners_Guide.pdf">Beginners guide</a> or the <a href="http://sourceware.org/systemtap/SystemTap_Beginners_Guide.pdf">Tutorial</a>. On Fedora systems when you install SystemTap you&#8217;ll find the tutorial at /usr/share/doc/systemtap-0.9.8/tutorial.pdf. SystemTap skills are handy for system administrators and developers, so if you fit into those categories I&#8217;d highly recommend you check it out.</p>
<p><strong>Random Thought:</strong> Where does /dev/zero come from and where does /dev/null go? What happens if you pipe /dev/zero to /dev/null?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielhall.me/2009/07/systemtap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux &#8216;top&#8217; Commands</title>
		<link>http://www.danielhall.me/2009/07/linux-top-commands/</link>
		<comments>http://www.danielhall.me/2009/07/linux-top-commands/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 10:43:40 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://server/~daniel/?p=3</guid>
		<description><![CDATA[<p>As a sysadmin working with Linux PCs I often need real time data on the status of the systems I manage. For example I might need to know what is using up all the bandwidth on an interface, whats taking up  all the memory or why my X displays are running sluggish. The impromptu
standard for [...]]]></description>
			<content:encoded><![CDATA[<p><span>As a sysadmin working with Linux PCs I often need real time data on the status of the systems I manage. For example I might need to know what is using up all the bandwidth on an interface, whats taking up  all the memory or why my X displays are running sluggish. The impromptu</span><br />
standard for naming these commands is to add the &#8216;top&#8217; suffix. Here  is a list of my favorite 8 &#8216;top&#8217; commands.</p>
<h4>top</h4>
<p><span>Top, the grandaddy of all the Linux top commands, is most useful for  monitoring tasks running on your system. On my Fedora system its contained  in package <span>procps</span> which on Fedora 11 was 3.2.7. Top has many <span>keybindings</span> to change its behaviour, for example &#8216;f&#8217; is used to add and remove fields, &#8216;o&#8217; will help you reorder those fields and the lesser-than and greater-than</span> keys move the search field. You can type &#8216;h&#8217; for a bigger list.</p>
<h4><span><span>tload</span></span></h4>
<p>You caught me! This one doesn&#8217;t end with top, but I put it here because on Fedora it comes as part of the <span><span>procps</span> packages with top, <span>slabtop</span> and others.</span> tload is a good application to have in a small terminal in the background.  It comes packaged along with top. It displays a histogram of the current load for the system. I like to have it running in a transparent terminal that I leave open on my laptop.</p>
<h4><span><span>htop</span></span></h4>
<p><span>An improved, menu driven and colourised version of normal top. <span>Htop</span> allows</span> you to get information on each thread of a program or combine all thread like normal top does. Some would argue that its more powerful, but others simply say its bloated. Whatever you believe, it has some nice features that any<span> sysadmin will appreciate and you&#8217;ll soon be wishing <span>htop</span> was <span>avaliable</span></span><br />
everywhere.</p>
<h4><span><span>iftop</span></span></h4>
<p><span>top is to <span>cputime</span> what <span>iftop</span> is to your network interfaces. It displays a</span> list of the top servers that are exchanging data over the selected interface. Because of the way it captures packets from the interface it needs root <span><span>privleges</span> to run.</span></p>
<h4><span><span>iotop</span></span></h4>
<p><span><span>iotop</span> displays live system IO statistics. Like top it lists the top</span> applications that are using IO. It can be toggled with the &#8216;o&#8217; key to only<br />
display programs currently performing IO, which is useful on large servers.<span> You can read more about its <span>keybindings</span> on its <span>manpage</span>.</span></p>
<h4><span><span>slabtop</span></span></h4>
<p><span><span>slabtop</span> is especially useful for kernel developers and pedantic system</span> tuners. It displays a summary of all the slab objects allocated in the kernel. I can take options to tell it how to display its information, but only has two <span><span>keybindings</span>, <span>spacebar</span> is to refresh the screen and &#8216;q&#8217; is to quit. You can</span> <span>see its options on its <span>manpage</span>.</span></p>
<h4><span><span>xrestop</span></span></h4>
<p><span>For X developers there is a utility called <span>xrestop</span>. <span>xrestop</span> displays a list</span> of X server resources allocated. It can be useful to see if your application, or your X server is leaking resources. While it only accepts the &#8216;q&#8217; key to exit it does accept a few options.</p>
<h4><span><span>powertop</span></span></h4>
<p>Built by Intel to help tune laptops to get the best performance out of your battery. It shows the percentage time spent in each CPU state and lists the<span> programs and devices that caused the most wake ups from idle mode. Its most</span> useful feature though is that it will analyse your system and give a suggestion on action to be taken to save just that little bit more power.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielhall.me/2009/07/linux-top-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
