<?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/tag/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>GPG Symmetric Encryption</title>
		<link>http://www.danielhall.me/2009/09/gpg-symmetric-encryption/</link>
		<comments>http://www.danielhall.me/2009/09/gpg-symmetric-encryption/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 03:35:24 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[GPG]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[System Administration]]></category>

		<guid isPermaLink="false">http://www.danielhall.me/?p=334</guid>
		<description><![CDATA[<p>I often come into a situation where I have to exchange some important confidential file with somebody who doesn&#8217;t have GPG keys setup. Explaining how to setup keys can be a pain, especially if you believe that the user will lose them or simply forget how to use them. There are all manner of propriety [...]]]></description>
			<content:encoded><![CDATA[<p>I often come into a situation where I have to exchange some important confidential file with somebody who doesn&#8217;t have GPG keys setup. Explaining how to setup keys can be a pain, especially if you believe that the user will lose them or simply forget how to use them. There are all manner of propriety software packages to deal with this but this post is about an easy free way using software that almost anyone has access to. I will be showing you how to do this using GPG on Unix operating systems. For windows you could follow <a href="http://mysys.wordpress.com/2006/11/02/setting-up-gnupg-in-windows/">this guide</a>.</p>
<h2>Encrypting</h2>
<p>To encrypt a file symmetrically using GPG just run:</p>
<pre class="brush: bash;">gpg --symmetric &lt;filename&gt;</pre>
<p>It will prompt you for a password twice and create a &lt;filename&gt;.gpg file in the current directory. If you want to put the encrypted text in an email then add the &#8211;armour flag. The &#8211;armour flag will cause gpg to instead output a &lt;filename&gt;.asc file which consists of ASCII text.</p>
<h2>Decrypting</h2>
<p>You decrypt it like any other GPG encrypted file:</p>
<pre class="brush: bash;">gpg -d &lt;filename&gt;.gpg</pre>
<p>This will prompt you for the password and decrypt the file, printing it to standard out.</p>
<h2>Tips</h2>
<ul>
<li>Don&#8217;t send the password and the attachment over the same medium, especially not in the same message. I suggest you send the email with the file and call and tell them the password.</li>
<li>GPG uses <a href="http://en.wikipedia.org/wiki/CAST-128">really strong encryption</a>, much more secure than that used in zipfile encryption. That said if you set the password to &#8217;123&#8242; or &#8216;password&#8217; no amount of encryption will help you. Your encryption is only as secure as the weakest point.</li>
<li>With enough time files like this can be cracked using brute force. You should still do all that you can to prevent the encrypted file falling into the wrong hands.</li>
<li>You really should setup GPG keys and publish them to a keyserver. That way you won&#8217;t have to worry about secure passphrase distribution.</li>
</ul>
<p><strong>Random Thought:</strong> How did people find the first search engine?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.danielhall.me/2009/09/gpg-symmetric-encryption/feed/</wfw:commentRss>
		<slash:comments>2</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>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>
