<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en"><title type="text">Aaron Toponce</title><link rel="alternate" type="text/html" href="http://pthree.org" /><subtitle type="html">Linux.  GNU.  Freedom.</subtitle><updated>2009-11-01T14:33:37+00:00</updated><generator>http://wordpress.org/?v=2.9-rare</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" /><link rel="self" href="http://feeds.feedburner.com/pthree" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry><title type="text">Get Your Unix Beard On</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/kB1XnvcGkJo/" /><category term="General" /><category term="Linux" /><category term="Personal" /><author><name>Aaron</name></author><updated>2009-11-01T06:33:37-08:00</updated><id>http://pthree.org/?p=1177</id><summary type="html">Today is the day, my friends. The day where the boys are separated from the men. The day tech support is separated from the system administrators. The day God smiles from on High. What am I referring to? Why, Whiskerino 2009, of course.
The concept is simple. Whiskerino is an Internet beard growing contest that happens [...]</summary><content type="html">&lt;p&gt;Today is the day, my friends. The day where the boys are separated from the men. The day tech support is separated from the system administrators. The day God smiles from on High. What am I referring to? Why, &lt;a href="http://whiskerino.org"&gt;Whiskerino 2009&lt;/a&gt;, of course.&lt;/p&gt;
&lt;p&gt;The concept is simple. Whiskerino is an Internet beard growing contest that happens biannually on the odd years. As a participant, you take a photo of yourself, and upload it to your account on the site. Other users of the contest will vote on the uploaded pics for the day. The pic with the most votes, becomes King Beard. However, not all is care free. There are some certain rules that you must abide by:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The contest runs from November 1, 2009 to February 28, 2010. You will be required to post a photo of yourself to your account at least once every 7 days.&lt;/li&gt;
&lt;li&gt;You must start on Day One completely clean shaven. Sideburns can not extend beyond the earlobe.&lt;/li&gt;
&lt;li&gt;You are required to grow a full beard. This means whiskers on the upper lip, cheeks, chin and neck.&lt;/li&gt;
&lt;li&gt;You are not allowed to shave the beard until the end of the contest. Trimming, shaping or styling are highly discouraged.&lt;/li&gt;
&lt;li&gt;The photo must be of the participant. It is not allowed to be altered in any way. Take the snapshot, and upload it.&lt;/li&gt;
&lt;li&gt;Photos must be 4&amp;#215;3 aspect ratio, no smaller than 500px in width. No nudity, profane gestures hateful, imagery, or otherwise offensive content. No more than one image per day can be submitted.&lt;/li&gt;
&lt;li&gt;Breaking any of the above rules results in the participant being placed into the Hall of Shame, from which he cannot return. You will be ejected from the contest.&lt;/li&gt;
&lt;li&gt;The winner will be chosen by participation in the contest, not just beard growth necessarily. This includes ratings on photos, overall spirit of the contest, attendance and beard style.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, I&amp;#8217;m all in. My wife fully supports my decision (at least until my brother&amp;#8217;s wedding in December, of which she might want some trimming or shaping done to the beard). I&amp;#8217;ve managed to talk a few of my friends into it as well. So, it will be fun to participate with them, and also make new friends in the contest. I&amp;#8217;ve never grown a full beard before. I&amp;#8217;ve always been a fan of the circle beard. So, this will be a new experience for me.&lt;/p&gt;
&lt;p&gt;Further, every Unix/Linux system administrator should be sporting full beard. It&amp;#8217;s part of our culture. It&amp;#8217;s who we are. Think of the Greats: Ken Thompson, Dennis Ritchie, Richard Stallman, Alan Cox, Brian Kernighan, and even Steve Jobs (back in the day) all sport beards (c&amp;#8217;mon Linus, where&amp;#8217;s your Unix beard?). I hope to be able to place my name among them. At least my coworker is fully bearded. Maybe I&amp;#8217;ll be able to grasp some of the vast amounts of Unix knowledge from him.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll later post the URL to my Whiskerino profile page. Because the photos are generally meant to be of the creative style for the contest, I&amp;#8217;ll be taking that photo, but I&amp;#8217;ll also be taking a photo that will suit well for a time lapse &amp;#8220;camera&amp;#8221;. This will probably go to my Picasa account, which I&amp;#8217;ll also provide a link to later. Lastly, for those reading my blog via RSS, you won&amp;#8217;t be able to get the benefit of watching the beard growth, unless Whiskerino provides an RSS feed to each profile page. I might post a photo here or there on the blog though. We&amp;#8217;ll see. However, there will be a side bar on my blog showing the daily snapshot of my ugly mug.&lt;/p&gt;
&lt;p&gt;In the immortal words of William Shakespeare in the play Much Ado About Nothing:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;He that hath a beard is more than a youth, and he that hath no beard is less than a man.&lt;br /&gt;
    ~ Beatrice speaking to Leonato&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=kB1XnvcGkJo:jJ2ShPifspk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/kB1XnvcGkJo" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/11/01/get-your-unix-beard-on/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><feedburner:origLink>http://pthree.org/2009/11/01/get-your-unix-beard-on/</feedburner:origLink></entry><entry><title type="text">Evil Maid</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/_HELJjIfVnY/" /><category term="Security" /><author><name>Aaron</name></author><updated>2009-10-23T06:10:51-07:00</updated><id>http://pthree.org/?p=1175</id><summary type="html">Two weeks ago, we had the Utah Open Source Conference, and I gave a presentation on how to crack passwords when you have physical access to a box. You can find my slides and materials here (3MB tar.gz). As an overview of my presentation, I discussed that if you have physical access to a machine, [...]</summary><content type="html">&lt;p&gt;Two weeks ago, we had the &lt;a href="http://2009.utosc.com"&gt;Utah Open Source Conference&lt;/a&gt;, and I gave a presentation on how to crack passwords when you have physical access to a box. &lt;a href="http://aarontoponce.org/utosc2009-toponce-archive.tar.gz"&gt;You can find my slides and materials here&lt;/a&gt; (3MB tar.gz). As an overview of my presentation, I discussed that if you have physical access to a machine, you can easily get administrative rights (root on Unix-like machines), and as a result, get access to the password database and user accounts, and use software to brute force the passwords out of the database.&lt;/p&gt;
&lt;p&gt;I then finished up showing how to break encrypted filesystems using the cold boot attack. &lt;a href="http://citp.princeton.edu/memory/"&gt;The University of Princeton has an excellent white paper, video and software on how to make this possible&lt;/a&gt;. The idea is simple- read the contents of RAM immediately after a shutdown, then use software to search through that memory dump finding a passphrase used on the encrypted filesystem. The only problem with this attack, is the limited scope of software in which it is effective against.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://theinvisiblethings.blogspot.com/2009/10/evil-maid-goes-after-truecrypt.html"&gt;Enter Evil Maid&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The idea is simple. Because you still have access to the target machine, rather than doing a cold boot attack, memory dumps and additional processing on the RAM dump, install a different boot loader that contains a key logger. When the target enters the encryption passphrase on his machine, the key logger will have grabbed every key stroke, either saving it somewhere on disk for later retrieval, sending it over the Internet to the attacker, or whatever is necessary to get the passphrase.&lt;/p&gt;
&lt;p&gt;THIS WILL WORK ON ANY OPERATING SYSTEM AND IS EFFECTIVE AGAINST ANY FILESYSTEM ENCRYPTION SOFTWARE!&lt;/p&gt;
&lt;p&gt;This is more effective than the cold boot attack, or even the &amp;#8220;&lt;a href="http://www.stoned-vienna.com/"&gt;stoned boot&lt;/a&gt;&amp;#8221; attack that Bruce Schneier covered earlier this year, but it&amp;#8217;s still not without its weaknesses. This attack assumes that the target will power on the computer at a later time, and enter the passphrase for the encrypted filesystem. The attacker would not want to actually steal the powered down computer.&lt;/p&gt;
&lt;p&gt;This is why it is called &amp;#8220;Evil Maid&amp;#8221;- you leave your computer in the hotel room, the housekeeping maid comes in to clean your room, but while there, installs the boot loader and key logger, then repowers down your computer. When you return to the hotel room, you power on, enter the passphrase, do you work, or whatever. The next day, when the maid returns, she returns, most likely to either retrieve the key and restore the previous boot loader, erasing her tracks. Now she has access to your data, can image the drive for offline analysis and have all sorts of nasty fun.&lt;/p&gt;
&lt;p&gt;This should say something about encrypted filesystems. They really only protect you if the drive is stolen, and the computer has been powered down. Other than that, there is an important security lesson to learn here. If someone has physical access to your computer, with the intent to do harm, &lt;a href="http://blogs.zdnet.com/security/?p=4662&amp;#038;tag=nl.e019"&gt;there is no stopping them&lt;/a&gt; from getting administrative rights on the machine, installing software, archiving data, imaging drives, etc. As a result, this should tell you something valuable: if possible, as in the case with laptops, keep your computer with you in untrusted environments.&lt;/p&gt;
&lt;p&gt;There are possible protective measures to protect yourself against such an attack. Storing your computer in a strong box under lock and key might work. Although the attacker only needs to be proficient with lock picks, this is a good first safe measure. Many hotels offer such strong boxes. Second would be hardening your BIOS to help prevent such an attack. Again, just a &amp;#8220;speed bump&amp;#8221; do a dedicated attacker, but it could be enough to deter. Lastly, because this attack assumes installing software on non-encrypted boot partitions or sectors, getting a hash of the non-encrypted boot partition and storing on a separate USB key could be valuable. Thus, when you travel, before you boot the machine from the hard disk, you could boot from a live CD, and check the hash of the boot sector against the hash stored on your key. Of course, if the attacker ever gets access to your USB key, the hash could be corrupted or modified.&lt;/p&gt;
&lt;p&gt;Long story short- don&amp;#8217;t leave sensitive data on your machine in untrusted environments, such as hotel rooms. Take your computer with you whenever you can and shut it down when not in use.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=_HELJjIfVnY:cqeUwlQ0FqI:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/_HELJjIfVnY" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/23/evil-maid/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">8</slash:comments><feedburner:origLink>http://pthree.org/2009/10/23/evil-maid/</feedburner:origLink></entry><entry><title type="text">Top Posting</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/wA-eWuOqDYk/" /><category term="General" /><author><name>Aaron</name></author><updated>2009-10-19T13:47:16-07:00</updated><id>http://pthree.org/?p=1165</id><summary type="html">Just doing my civic duty, here is a posting by Stuart Jansen to the Salt Lake Linux Users Group mailing list:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after [...]</summary><content type="html">&lt;p&gt;Just doing my civic duty, &lt;a href="http://sllug.org/pipermail/sllug-members/2009-March/011365.html"&gt;here is a posting by Stuart Jansen to the Salt Lake Linux Users Group mailing list&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;A: Because it messes up the order in which people normally read text.&lt;br /&gt;
Q: Why is top-posting such a bad thing?&lt;br /&gt;
A: Top-posting.&lt;br /&gt;
Q: What is the most annoying thing in e-mail?&lt;br /&gt;
A: No.&lt;br /&gt;
Q: Should I include quotations after my reply?&lt;/p&gt;
&lt;p&gt;See also: &lt;a href="http://www.faqs.org/rfcs/rfc1855.html"&gt;http://www.faqs.org/rfcs/rfc1855.html&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.catb.org/jargon/html/T/top-post.html"&gt;http://www.catb.org/jargon/html/T/top-post.html&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Enough said.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=wA-eWuOqDYk:V3nEi9dTImA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/wA-eWuOqDYk" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/19/top-posting/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://pthree.org/2009/10/19/top-posting/</feedburner:origLink></entry><entry><title type="text">A Case For HTML Email – Mashups</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/6gvLoBjmpjc/" /><category term="Firefox" /><category term="General" /><author><name>Aaron</name></author><updated>2009-10-17T06:09:13-07:00</updated><id>http://pthree.org/?p=1159</id><summary type="html">You know, I had this massive post all typed up arguing why HTML email isn&amp;#8217;t inherently evil. Seriously, it was approaching 2000 words. Then I realized something- I&amp;#8217;m over complicating the issue. Everything I was trying to say in the post, can be summed up in this video, showing off Ubiquity from Mozilla Labs. Basically, [...]</summary><content type="html">&lt;p&gt;You know, I had this massive post all typed up arguing why HTML email isn&amp;#8217;t inherently evil. Seriously, it was approaching 2000 words. Then I realized something- I&amp;#8217;m over complicating the issue. Everything I was trying to say in the post, can be summed up in this video, showing off Ubiquity from Mozilla Labs. Basically, what you are about to see in a couple examples in the video, you can&amp;#8217;t do with &amp;#8220;plain text&amp;#8221; email. This is a video for Ubiquity, which does a lot more, but I think you&amp;#8217;ll get the idea.&lt;/p&gt;
&lt;p&gt;&lt;center&gt;&lt;object width="400" height="298"&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=1561578&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=1561578&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="298"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;p&gt;&lt;a href="http://vimeo.com/1561578"&gt;Ubiquity for Firefox&lt;/a&gt; from &lt;a href="http://vimeo.com/user532161"&gt;Aza Raskin&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/center&gt;&lt;/p&gt;
&lt;p&gt;Now, here&amp;#8217;s the funny thing. For those arguing the case for plain text email- you are &lt;em&gt;explicitly&lt;/em&gt; putting yourself in a &amp;#8220;plain text world&amp;#8221;. When someone sends you something, say a mashup of a restaurant review, and you can&amp;#8217;t view it with mutt, who&amp;#8217;s problem is that? The sender, or the receiver? Think about that for a second. It&amp;#8217;s 2009. We should be able to do so much more with email than we&amp;#8217;re currently doing, as Aza states, but the plain text folks aren&amp;#8217;t interested in that. &amp;#8220;Gimme the text, remove the bloat. The web belongs on the web.&amp;#8221; they&amp;#8217;ll say. Well, I guess the world is interested in passing them by.&lt;/p&gt;
&lt;p&gt;Full disclosure- I have been a heavy plain text email advocate in the past. &lt;a href="http://pthree.org/2009/04/18/new-email-signature/"&gt;Post 0&lt;/a&gt; and &lt;a href="http://pthree.org/2006/12/29/ascii-ribbon-campaign/"&gt;post 1&lt;/a&gt; demonstrate that. Let&amp;#8217;s just say I&amp;#8217;ve had a change of heart. I want to do more with my email. Also, I&amp;#8217;ll be sending all my emails in both plain text and HTML encoding, for those who insist on living in the past as well as for those who actually want to enjoy their email.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=6gvLoBjmpjc:jXq4g4GoSzE:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/6gvLoBjmpjc" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/17/a-case-for-html-email-mashups/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">22</slash:comments><feedburner:origLink>http://pthree.org/2009/10/17/a-case-for-html-email-mashups/</feedburner:origLink></entry><entry><title type="text">Dear Qwest</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/uBa8hz0h43c/" /><category term="Personal" /><author><name>Aaron</name></author><updated>2009-10-15T21:30:14-07:00</updated><id>http://pthree.org/?p=1155</id><summary type="html">A friend of mine just recently signed up for your land line telephone residential service. Within days, he has already been getting a slew of solicitation phone calls. He hasn&amp;#8217;t even had the chance to hand out his number, and already, he&amp;#8217;s getting quite the barrage of solicitors. Yet, I have a Google Voice number [...]</summary><content type="html">&lt;p&gt;A friend of mine just recently signed up for your land line telephone residential service. Within days, he has already been getting a slew of solicitation phone calls. He hasn&amp;#8217;t even had the chance to hand out his number, and already, he&amp;#8217;s getting quite the barrage of solicitors. Yet, I have a Google Voice number that hasn&amp;#8217;t seen a single unwanted call. I&amp;#8217;ve only had it for a few months, but it&amp;#8217;s certainly been much, much longer than my friend&amp;#8217;s, and I&amp;#8217;m handing it to anyone and everyone. I gave it to my school, a car repair shop, Apple Computer, a number of retail shops, friends and family, and so forth. I call tons with it too.&lt;/p&gt;
&lt;p&gt;So, can you explain that to me? Why is his fresh number getting spammed, while mine remains completely spam-free? Is selling personal information part of your business plan too? Just curious. Oh, and by the way, I&amp;#8217;m not a customer. I left your &amp;#8220;Spirit of Service&amp;#8221;, because it wasn&amp;#8217;t any good.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=uBa8hz0h43c:DjntGwqKguA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/uBa8hz0h43c" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/15/dear-qwest-2/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">8</slash:comments><feedburner:origLink>http://pthree.org/2009/10/15/dear-qwest-2/</feedburner:origLink></entry><entry><title type="text">More ZSH Prompt Love</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/xYqWzhxHmHU/" /><category term="Personal" /><category term="Scripting" /><author><name>Aaron</name></author><updated>2009-10-14T07:51:24-07:00</updated><id>http://pthree.org/?p=1148</id><summary type="html">Ever since discovering ZSH 3 years ago, I&amp;#8217;ve been addicted, but it wasn&amp;#8217;t until a good 2 years into using the prompt on a daily basis that I decided to do some radical work with my prompt. I&amp;#8217;ve blogged about this before a couple times, making improvements along the way: post 0, post 1, post [...]</summary><content type="html">&lt;p&gt;Ever since discovering ZSH 3 years ago, I&amp;#8217;ve been addicted, but it wasn&amp;#8217;t until a good 2 years into using the prompt on a daily basis that I decided to do some radical work with my prompt. I&amp;#8217;ve blogged about this before a couple times, making improvements along the way: &lt;a href="http://pthree.org/2008/01/31/my-zsh-prompt/"&gt;post 0&lt;/a&gt;, &lt;a href="http://pthree.org/2008/03/29/my-zsh-prompt-improved/"&gt;post 1&lt;/a&gt;, &lt;a href="http://pthree.org/2008/11/23/727/"&gt;post 2&lt;/a&gt;, &lt;a href="http://pthree.org/2009/03/28/add-vim-editing-mode-to-your-zsh-prompt/"&gt;post 3&lt;/a&gt;. Check out those posts if you&amp;#8217;re interested in what I&amp;#8217;ve done to the prompt, and extra screenshots.&lt;/p&gt;
&lt;p&gt;At the Utah Open Source Conference, I gave a BOF on Unix shells. The turnout was good, and we had a great discussion. I presented on my default prompt for ZSH, showing all the hidden features of the prompt. However, I had forgotten that I had removed battery status from my prompt, because I was depending on APM, which is no longer compiled in the kernel. A couple people have asked me since then why I&amp;#8217;m depending on APM and not ACPI. I don&amp;#8217;t have an answer, other than that was just what I coded. So, last night, I put up an ACPI implementation, and it works great. As with the APM implementation, if the battery percentage is less than 15%, the percentage display is red. If it&amp;#8217;s less than 50% but greater than 14%, it&amp;#8217;s yellow, and if it&amp;#8217;s less than 100% but greater than 49%, it&amp;#8217;s blue. If it&amp;#8217;s 100%, or the tool &amp;#8220;acpi&amp;#8221; is not installed, then it doesn&amp;#8217;t show up. Here&amp;#8217;s a screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://pthree.org/wp-content/uploads/2009/10/battery-34percent.png" alt="Battery Percentage in ZSH prompt" title="Battery Percentage in ZSH prompt" width="570" height="388" class="aligncenter size-full wp-image-1150" /&gt;&lt;/p&gt;
&lt;p&gt;While hanging out in our local LUG channel for the Ogden Area Linux Users Group, I got talking with Seth about prompts. He decided to change his, including adding the dog from Nethack randomly &amp;#8220;moving&amp;#8221; in the prompt. He also mentioned changing the color of the path if the present working directory was not writable. I really liked this idea, and decided to implement it in my prompt. Here&amp;#8217;s a screenshot of that in action:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://pthree.org/wp-content/uploads/2009/10/path-color-change.png" alt="Path color change in ZSH prompt" title="Path color change in ZSH prompt" width="570" height="388" class="aligncenter size-full wp-image-1151" /&gt;&lt;/p&gt;
&lt;p&gt;I change the path color to yellow if the present working directory is not writable, as it&amp;#8217;s noticeable enough to catch your attention, but subtle enough to not get in the way, and be distracting.&lt;/p&gt;
&lt;p&gt;As usual, if you want the source, &lt;a href="http://pthree.org/wp-content/uploads/2009/10/zsh-prompt.txt"&gt;here it is&lt;/a&gt;. Yes, it&amp;#8217;s public domain, as mentioned in the code, so have at it.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=xYqWzhxHmHU:Rj9I7CnhIrI:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/xYqWzhxHmHU" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/14/more-zsh-prompt-love/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://pthree.org/2009/10/14/more-zsh-prompt-love/</feedburner:origLink></entry><entry><title type="text">7 Reasons Why I Have NOT Switched To Google Chrome From Firefox</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/DUnIYXa9Kvo/" /><category term="Ubuntu" /><author><name>Aaron</name></author><updated>2009-10-12T21:45:04-07:00</updated><id>http://pthree.org/?p=1138</id><summary type="html">I just finished reading 7 Reasons Why I Switched to Google Chrome from Firefox. I found the article a bit on the fanboy side, and I&amp;#8217;ll address each of his points here, while also saying my reasons why I&amp;#8217;m still holding on to the Firefox browser as my default browser.
First, Andrew mentions that Google Chrome [...]</summary><content type="html">&lt;p&gt;I just finished reading &lt;a href="http://webstudio13.com/2009/10/02/7-reasons-why-i-switched-to-google-chrome-from-firefox/"&gt;7 Reasons Why I Switched to Google Chrome from Firefox&lt;/a&gt;. I found the article a bit on the fanboy side, and I&amp;#8217;ll address each of his points here, while also saying my reasons why I&amp;#8217;m still holding on to the Firefox browser as my default browser.&lt;/p&gt;
&lt;p&gt;First, Andrew mentions that Google Chrome has a &amp;#8220;much faster loading time&amp;#8221;. I have Google Chrome installed on both my work laptop running Windows XP and two of my GNU/Linux machines, one running Ubuntu 9.04, the other running Debian Sid. In all three cases, Google Chrome does launch from cold boot noticeably faster than Firefox, but the daily web browsing is not so noticeable. Unless I&amp;#8217;m benchmarking the two browsers side-by-side, which is really only good for showing benchmarks, I don&amp;#8217;t see any recognizable differences in speed when rendering HTML, CSS or JavaScript. I&amp;#8217;ve used both Chrome and Firefox with Gmail, Google Wave, and many, many other processor-intensive sites, and I see no such conclusion that Chrome has a &amp;#8220;much faster loading time&amp;#8221; versus Firefox, who is making the web a slow experience.&lt;/p&gt;
&lt;p&gt;Second, he addresses that Chrome doesn&amp;#8217;t crash. Funny you say that. I&amp;#8217;ve had both the stable version running on Windows XP and the unstable version running on GNU/Linux tank very recently. It only happened once, in both operating systems, and I have not been able to reproduce it, but it wasn&amp;#8217;t just a tab failure. The whole browser went south. I honestly don&amp;#8217;t even know what happened, but I do know what I was doing, and what was lost, but I&amp;#8217;ll address that in a second.&lt;/p&gt;
&lt;p&gt;Thirdly, he likes some of the snazzy tab features with Chrome. It&amp;#8217;s apparent though, that the features he addresses in Chrome also exist in vanilla Firefox 3.5, such as the ability close all tabs other than the open tab (right-click the open tab, select &amp;#8220;Close other tabs&amp;#8221;). I do wish Firefox would get closing tab order and tab placement correct though. It does bother me that when I open a link in a new tab, it doesn&amp;#8217;t open the tab right next to the current, and when closing tabs, it doesn&amp;#8217;t do so in oldest to most recent opened tab. However, that&amp;#8217;s the beauty of Firefox- extensions, which again, I&amp;#8217;ll cover in a minute.&lt;/p&gt;
&lt;p&gt;Fourth, I do like the default home page in Chrome, and I wish Firefox had it. I&amp;#8217;m hoping we&amp;#8217;ll see it in 3.6 or maybe 4.0. However, it&amp;#8217;s hardly anything new. As usual, Opera pioneered the feature, Safari followed suit, then Chrome. It is a leg up on Firefox, however.&lt;/p&gt;
&lt;p&gt;Fifth, the Omnibar in Chrome is no different than the AwesomeBar in Firefox, except for the search functionality. But, seeing as though the search box in Firefox is just a tab keystroke away, I hardly find this inconvenient, and worthy of a reason for switching browsers. Further, it&amp;#8217;s limited in its search scope- it can only search from one engine, Google by default. The search bar in Firefox is much more customizable, giving you the option to add virtually any search engine to the browser. Google, Wikipedia, eBay, Ubuntu packages, and so forth. Sure, you can change the default search in the options in Chrome, but you have to change the option by opening the options dialog every time you want to make the change, rather than just do it on the spot ad hoc.&lt;/p&gt;
&lt;p&gt;The sixth option is just silly. Known more widely as &amp;#8220;porn mode&amp;#8221;, every major browser comes with this feature, even in Firefox 3.5. A mere &amp;#8220;ctrl+shift+p&amp;#8221; will put Firefox into &amp;#8220;Private Browsing&amp;#8221;, not saving an ounce of history to disk. Further, rather than opening a new window, it caches off your currently open tabs, closes them, and puts the new porn mode tab as the current tab, all in the same window. When you&amp;#8217;re finished, stopping private browsing will restore your tabs from the saved cache, including any text you might have typed in any form field. Sorry, but this point I found rather silly.&lt;/p&gt;
&lt;p&gt;The seventh point is likely just as silly. Firefox has had a bright future from the outset. It truly is the poster child for a grass roots open source project that becomes mainstream. Version 3.6 is looking up, and 4.0 has a bright future as well. According to the browser market share trends, Firefox has been &lt;a href="http://gs.statcounter.com/#browser-ww-monthly-200809-200910"&gt;up&lt;/a&gt;, &lt;a href="http://www.w3schools.com/browsers/browsers_stats.asp"&gt;up&lt;/a&gt;, &lt;a href="http://marketshare.hitslink.com/browser-market-share.aspx?qprid=1"&gt;up&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, here are seven reasons why I won&amp;#8217;t be switching from Firefox to Google Chrome as my default browser in the foreseeable future:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Extensions&lt;/b&gt;- I know this is &amp;#8220;in the works&amp;#8221; for Google Chrome, but I can&amp;#8217;t ditch Firefox just yet. I have a must set of extensions for every install of Firefox I ever make. I used to keep an updated list of such extensions, but I haven&amp;#8217;t updated in a while. Maybe I should do so. But, on every install, I need AdBlock Plus, FoxyProxy, FireFTP, Firebug, Web Developer, Tab Mix Plus, Weave, NoScript and Flashblock, just to name a few. Again, I understand it&amp;#8217;s only a matter of time with Chrome before extensions appear, and they will sand-boxed too, increasing the stability and security of the browser. However, Chrome isn&amp;#8217;t there yet, and as such, Firefox remains my browser.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Caching&lt;/b&gt;- Firefox is the only browser that I know of that gets caching right. If, for any reason, my browser crashes, and I was typing an email, when I pull the browser back up, not only are my tabs restored, but the data in the tabs as well, including each tab history, and the text in any form fields that I was editing (provided I&amp;#8217;m keeping a history of everything, as is default on a new install). I can&amp;#8217;t even begin to tell you how valuable this feature is. Yes, the whole browser crashes with Firefox, versus single tabs with Chrome, but when Firefox comes up, my data is in tact. When I restore the tab with Chrome, form fields and text boxes that were once populated are now blank.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Cross Platform&lt;/b&gt;- Even though I have Google Chrome installed on my Debian and Ubuntu machines, Google Chrome is still very much a Windows application. It just hasn&amp;#8217;t reached prime time for Mac OS X or GNU/Linux. So, unless I&amp;#8217;m ready and willing to take the rolls with the punches, I&amp;#8217;m stuck on Windows. Yes, Google Chrome is getting more and more usable every day on GNU/Linux, but it&amp;#8217;s still unstable and comes with bugs.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Portable Firefox&lt;/b&gt;- Being a college student, I&amp;#8217;ve come to love &lt;a href="http://portableapps.com"&gt;Portableapps.com&lt;/a&gt;. I can take so many applications with me on a USB stick, plug them into a Windows machine at school, and off I go. Firefox is no exception. I can have all my extensions, plugins, settings, bookmarks and so forth with me on a single USB stick. This way, I don&amp;#8217;t have to worry about installing Firefox should it not be installed, and I don&amp;#8217;t have to prep it installing and configuring it the way I like. So, until Chrome becomes a portable app as well, which I don&amp;#8217;t think should take long, Firefox is here to stay.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Speed&lt;/b&gt;- Firefox is still a fast browser, and 3.6 is looking to up the ante even more. Tracemonkey is comparable to speed with V8 in terms of JavaScript engines, and HTML/CSS rendering is also snappy. In fact, I noticed a great improvement from 3.0 to 3.5 in terms of speed. And when browsing the sites I do from day-to-day with Firefox and Chrome, I honestly can&amp;#8217;t tell if one is faster than the other. Yes, from a cold boot, Firefox is a second slower. Maybe two. Other than that, IMO, it&amp;#8217;s neck and neck, and as a result, I see no reason to switch browsers if speed is a factor.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Configurability&lt;/b&gt;- Firefox is the only browser I know of that tinkering under the hood is a snap. Just pulling up the &amp;#8220;about:config&amp;#8221; URI, and I can tweak to my hearts content, and I have. I&amp;#8217;ve modified the way DNS is handled. I&amp;#8217;ve modified the way proxies are setup. I&amp;#8217;ve changed the backspace key behavior, and much more, and it&amp;#8217;s easy. Further, if I don&amp;#8217;t like the setting I&amp;#8217;ve made, I just change it back, all while it&amp;#8217;s running in a tab in the browser. No need for open dialog windows, or taking you away from your work.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Support&lt;/b&gt;- This might seem like somewhat of a weak point, but Google Chrome has a bit to go before the community reaches the masses that Firefox has amassed. Support forms, IRC channels, wikis, mailing lists and on and on. If I need help with the Firefox browser, I&amp;#8217;m likely to get the support I&amp;#8217;m looking for, regardless of the platform. As Google Chrome increases it&amp;#8217;s market share, there&amp;#8217;s no doubt that it will increase it&amp;#8217;s support options and community as well. However, it&amp;#8217;s not there yet, and literally pales in comparison to Firefox. There is strength in numbers.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These may or may not be your reasons for sticking with Firefox, but they are certainly mine. Firefox is a solid browser that is showing tons, and tons of potential. While it might not have some bells and whistles that Chrome has, such as a process per tab, or sandboxing extensions, it&amp;#8217;s still a robust and stable browser, and as a result, still remains my default browser.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=DUnIYXa9Kvo:cBZfdW04KyM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/DUnIYXa9Kvo" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/10/12/7-reasons-why-i-have-not-switched-to-google-chrome-from-firefox/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">25</slash:comments><feedburner:origLink>http://pthree.org/2009/10/12/7-reasons-why-i-have-not-switched-to-google-chrome-from-firefox/</feedburner:origLink></entry><entry><title type="text">WIFI FAIL</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/qMnrvr1b4fk/" /><category term="General" /><category term="Personal" /><author><name>Aaron</name></author><updated>2009-09-09T06:28:48-07:00</updated><id>http://pthree.org/?p=1132</id><summary type="html">While taking the bus home yesterday from work, I needed to login to work over the VPN and get some stuff done, before the next day started. The express bus I take home has free WIFI on the bus. Unfortunately, it&amp;#8217;s anything but reliable or stable. I kept losing the connection, then I would have [...]</summary><content type="html">&lt;p&gt;While taking the bus home yesterday from work, I needed to login to work over the VPN and get some stuff done, before the next day started. The express bus I take home has free WIFI on the bus. Unfortunately, it&amp;#8217;s anything but reliable or stable. I kept losing the connection, then I would have to reconnect, then it would drop, then reconnect, etc. While going through this, I noticed in the WIFI applet for Windows XP that it tells me I currently not connected, but if I wish to disconnect, I need to click the disconnect button. So which is it? Am I connected, or not? If I click the disconnect button, I guess it disconnects me, but when I click the button again to connect, it says again that I&amp;#8217;m currently not connected, and if I wish to disconnect, click disconnect. Confusing as hell, I figure it&amp;#8217;s loaded with FAIL, and that it would be fun to show.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://pthree.org/wp-content/uploads/2009/09/wifi-fail.png" alt="Screenshot showing me connected or not connected to the UTA WIFI." title="WIFI FAIL" width="660" height="503" class="size-full wp-image-1133" /&gt;&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=qMnrvr1b4fk:RYHYQGMAgdw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/qMnrvr1b4fk" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/09/09/wifi-fail/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://pthree.org/2009/09/09/wifi-fail/</feedburner:origLink></entry><entry><title type="text">Scrubbing Hard Disk Data</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/bCGzfoWXmxI/" /><category term="Linux" /><category term="Security" /><author><name>Aaron</name></author><updated>2009-08-31T18:52:26-07:00</updated><id>http://pthree.org/?p=1120</id><summary type="html">I&amp;#8217;ve recently had the opportunity with wiping 13 SCSI drives. The drives are small- 36 and 18 gigabyte drives, and they do contain sensitive data. They will be sent off to a third party for physical destruction, but we need to make sure that the data is completely overwritten on the disk in a secure [...]</summary><content type="html">&lt;p&gt;I&amp;#8217;ve recently had the opportunity with wiping 13 SCSI drives. The drives are small- 36 and 18 gigabyte drives, and they do contain sensitive data. They will be sent off to a third party for physical destruction, but we need to make sure that the data is completely overwritten on the disk in a secure manner. This means using a utility that can overwrite bit-for-bit on the disk level. Fortunately, there are many utilities for making this possible.&lt;/p&gt;
&lt;p&gt;The most popular of these, is DBAN, or Darik&amp;#8217;s Boot and Nuke. It comes as a CD or USB image that you boot from, rather than the disk, then choose in a menu which wiping method you wish to choose. Of the choices, there are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Quick Erase&lt;/strong&gt;- One pass, writing nothing but zeroes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;RCMP TSSIT OPS-II&lt;/strong&gt;- Eight passes using random writes and compliments on each pass.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DoD Short&lt;/strong&gt;- Three pass version of the stronger seven pass below. Each pass is random data written.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DoD 5220.22-M&lt;/strong&gt;- Sever passes using random data at each pass.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gutmann Wipe&lt;/strong&gt;- 35 passes across the hard drive as described by security expert Peter Gutmann and Colin Plumb.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PRNG&lt;/strong&gt;- Arbitrary number of passes specified by the user using a pseudo random number generator for writing random data on each pass.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For most secure scrubbing purposes, a quick erase is more than good enough. There have been no published papers to date on recovering overwritten date after a single pass. Is that to say it&amp;#8217;s not possible? No, of course not. For what it&amp;#8217;s worth, all the drives that leave my possession only get a single pass. However, if you or or organization is more paranoid about getting the data off the platters, there are other options available that will do more passes on the drive.&lt;/p&gt;
&lt;p&gt;The next option in the DBAN menu is the RCMP TSSIT OPS-II wipe. This pass uses a source for a pseudo-random number generator as the first pass, then produces the compliment of that first pass as the data for the second. The idea behind this method is switch the bit on the disk platter from one to zero as often as possible. By using a random source for the initial pass, then writing the compliment, we&amp;#8217;ve successfully written two passes on disk. At this point, it should be &amp;#8220;good enough&amp;#8221; for even the most seasoned data recovery company. However, this pass does that dance three more times, for a total of eight passes.&lt;/p&gt;
&lt;p&gt;The Department of Defense, in the United States of America, has established a standard for sanitizing disks that contain TOP SECRET data. They have two standards. The first is the &amp;#8220;DoD Short&amp;#8221; wipe. This is a short three pass wipe. Nothing fancy about it. Each pass uses a pseudo-random number generator as the source for the overwriting data, and makes three passes with this source. The &amp;#8220;DoD 5220.22-M&amp;#8221; is the more secure DoD sanitization method, which uses seven passes across the disk instead of three. Each pass uses a pseudo-random number generator for the source of the data.&lt;/p&gt;
&lt;p&gt;The next method is for the ultra-paranoid company or individual. This wipe is known as the &amp;#8220;Gutmann Wipe&amp;#8221;, and it&amp;#8217;s built to take advantage of different hard disk encoding mechanisms. Essentially, there are two main encoding schemes for storing the data on your disk: MFM and RLL. All modern drives today use the RLL encoding scheme. Essentially, RLL is a lossless compression encoding scheme, making it possible to fit more data on the disk platters. Because MFM and RLL store data differently on the drive, using a certain method might be optimized for MFM encoded drives, but won&amp;#8217;t work well with RLL and vice-versa.&lt;/p&gt;
&lt;p&gt;The method behind calculating the data to the disk is rather simple: generate a unique list of one-bit numbers (zeros and ones), then two-bit numbers, then a three-bit numbers, then finally four-bit numbers uniquely. After this list of numbers has been generated, begin writing. This list is as defined in hexadecimal:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;1-bit: 0&amp;#215;000, 0xFFF&lt;/li&gt;
&lt;li&gt;2-bit: 0&amp;#215;555, 0xAAA&lt;/li&gt;
&lt;li&gt;3-bit: 0&amp;#215;249, 0&amp;#215;492, 0&amp;#215;942, 0&amp;#215;6DB, 0xB6D, 0xDB6&lt;/li&gt;
&lt;li&gt;4-bit: 0&amp;#215;111, 0&amp;#215;222, 0&amp;#215;333, 0&amp;#215;444, 0&amp;#215;666, 0&amp;#215;777, 0&amp;#215;888, 0&amp;#215;999, 0xBBB, 0xCCC, 0xDDD, 0xEEE&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you want to convert this list to binary, then think about it in terms of the &amp;#8220;number of bits&amp;#8221;. For example, with one bit, you only have two options: a zero or a one. With two bits, you have a possible combination of 4 numbers: all zeroes, all ones, zero then one or one then zero. Because we&amp;#8217;ve already defined &amp;#8220;all zeroes&amp;#8221; and &amp;#8220;all ones&amp;#8221; in the one-bit number, we don&amp;#8217;t need to repeat them in the 2-bit, 3-bit or 4-bit representation. Now, why repeating that bit 3 times? Well, the least common denominator of three and four is twelve. The idea is that I&amp;#8217;m writing patterns, not necessarily static data. So, the pattern needs to repeat through the 12-bit number. For example, take the 4-bit number
&lt;pre&gt;0x999&lt;/pre&gt;
&lt;p&gt; What is this in a 12-bit binary representation? Isn&amp;#8217;t it:
&lt;pre&gt;100110011001&lt;/pre&gt;
&lt;p&gt; or if you were to separate it out:
&lt;pre&gt;1001 1001 1001&lt;/pre&gt;
&lt;p&gt; Do you see the pattern of two ones followed by two zeroes, followed by two ones followed by two zeroes, etc? That&amp;#8217;s the idea. Writing patterns to the disk.&lt;/p&gt;
&lt;p&gt;So, how do we put all these numbers together, so we can sanitize the data securely for both RLL and MFM drives? &lt;a title="Gutmann Method" href="http://en.wikipedia.org/wiki/Gutmann_method" target="_blank"&gt;Wikipedia has a good article on it&lt;/a&gt;, and explains that the first and last four writes are random data from a secure random number generator. Then, at pass five through pass 31, we use the 1-bit through 4-bit numbers we came up with, and begin writing, some of them used two or three times, based on the drive encoding scheme it&amp;#8217;s targeting.&lt;/p&gt;
&lt;p&gt;Lastly, if this isn&amp;#8217;t enough, you have one last option, where you can specify the number of passes for wiping the data. The pseudo-random number generator that is used for the other passes is chosen here, and each pass writes random data to the disk.&lt;/p&gt;
&lt;p&gt;This is a great utility for sanitizing disks, however, I&amp;#8217;ve found DBAN to be spotty on certain hardware configurations. For one, it&amp;#8217;s x86-based only, which means you won&amp;#8217;t be able to boot this on Sparc or HPPA-RISC hardware. Also, even on some x86-based hardware, I&amp;#8217;ve found DBAN to hardlock, not ever getting to the menu for me to begin wiping. So, what can I do? Am I up a creek without a paddle? Most definitely not!&lt;/p&gt;
&lt;p&gt;KNOPPIX is a solid LiveCD that loads the Linux kernel and the Debian user-space utilities, giving you a live desktop, complete with all the tools you would need for rescuing and wiping machines. KNOPPIX has been soundly tested against a vast array of hardware, and it sees very active development with a vibrant community behind it. How can KNOPPIX securely delete the data off your drives? Well, GNU Shred from the &lt;a href="http://www.gnu.org/software/coreutils/"&gt;GNU Coreutils&lt;/a&gt; package is a flexible package for choosing the number of passes against a drive. Because you&amp;#8217;ve booted into a live Linux environment, you also have /dev/zero, /dev/random and /dev/urandom as a source of endless data for sending to your drives. In my specific situation of wiping the 13 SCSI drives, I booted into a KNOPPIX CD, executed &amp;#8217;shred&amp;#8217; and told it to do three passes, then one last pass of zeroes, hiding any evidence of data sanitization. Many other GNU/Linux distributions provide live environments (CD or USB) that you could take advantage of. Ubuntu, openSUSE, Debian and Fedora are just a few worth mentioning.&lt;/p&gt;
&lt;p&gt;Of course, if you&amp;#8217;re running an encrypted filesystem worth its salt, then there really is no practical reason for scrubbing the data off your drives, and the encrypted representation of your data doesn&amp;#8217;t mean squat without the private key to that data.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=bCGzfoWXmxI:sITJC2Jo3FY:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/bCGzfoWXmxI" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/08/31/scrubbing-hard-disk-data/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">11</slash:comments><feedburner:origLink>http://pthree.org/2009/08/31/scrubbing-hard-disk-data/</feedburner:origLink></entry><entry><title type="text">Moving to Movable Type</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/Cm-mW8JzgzE/" /><category term="Personal" /><author><name>Aaron</name></author><updated>2009-08-21T23:00:58-07:00</updated><id>http://pthree.org/?p=1117</id><summary type="html">After weighing in the pros and cons, it looks like I&amp;#8217;ll be migrating my blog, and all of it&amp;#8217;s data to a Movable Type install, rather than a Wordpress install? Why? I&amp;#8217;m hoping to take some strain off the server by removing the database on the posts.
Honestly, I don&amp;#8217;t know why blog engines have databases [...]</summary><content type="html">&lt;p&gt;After weighing in the pros and cons, it looks like I&amp;#8217;ll be migrating my blog, and all of it&amp;#8217;s data to a Movable Type install, rather than a Wordpress install? Why? I&amp;#8217;m hoping to take some strain off the server by removing the database on the posts.&lt;/p&gt;
&lt;p&gt;Honestly, I don&amp;#8217;t know why blog engines have databases for posts, when static HTML files can be produced rather effortlessly. I understand WP Cache does something similar, but I&amp;#8217;ve had mixed results with that plugin. &lt;/p&gt;
&lt;p&gt;Anyway, the blog migration will probably happen sometime this weekend, ready for a new life Monday. Also, I&amp;#8217;m hoping that I can preserve date timestamps in the RSS feed, so as to not spam the planets that I currently push to. I&amp;#8217;ll be testing in a development environment first, to make sure everything goes smooth, not like you care. &lt;img src='http://pthree.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;p&gt;See you on the other side.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=Cm-mW8JzgzE:lHru-yJS0aQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/Cm-mW8JzgzE" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/08/21/moving-to-movable-type/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">9</slash:comments><feedburner:origLink>http://pthree.org/2009/08/21/moving-to-movable-type/</feedburner:origLink></entry><entry><title type="text">Mobile LVM</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/QVdy_bclMuE/" /><category term="Linux" /><author><name>Aaron</name></author><updated>2009-08-16T02:16:56-07:00</updated><id>http://pthree.org/?p=1099</id><summary type="html">Today, as my wife and I were headed into Target, I thought of the cheap USB thumb drives they usually have on sale, and I was tempted to purchase some. Then I got to thinking: what if I could use those thumb drives as one disk, using LVM, and have the ability to take that [...]</summary><content type="html">&lt;p&gt;Today, as my wife and I were headed into Target, I thought of the cheap USB thumb drives they usually have on sale, and I was tempted to purchase some. Then I got to thinking: what if I could use those thumb drives as one disk, using LVM, and have the ability to take that LVM structure from computer to computer? For example, say I have 6 2GB USB thumb drives. I have 12GB of storage total. Maybe I want to fit a DVD ISO or two on the disks. LVM would be perfect for this, if it remains on one computer. Wouldn&amp;#8217;t it be nice if I could take those 6 drives to another computer, scan for the LVs, and mount them, keeping all my data in perfect order? Well, after a bit of hacking about, I figured it out, and it&amp;#8217;s cleaner than you would think.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m not going to bother teaching you about the concepts behind LVM here. Suffice it to say, that LVM provides complete flexibility and control over your disk pools, where editing and manipulating partitions would be troublesome. The idea behind LVM is to create a pool of disk space, whether it comes from one drive, or many, and have the ability to chop up that pool to create mount points easily, as well as resizing the volumes, either larger or smaller.&lt;/p&gt;
&lt;p&gt;So, to get started, let&amp;#8217;s keep it simple. I have two 32MB USB thumb drives with me right now for this post. When I plug them into my computer, my Linux kernel might recognize them as /dev/sdy and /dev/sdz, for example. You can find these results by running &amp;#8220;fdisk -l&amp;#8221; as root, checking the end of the dmesg command, or checking the end of /var/log/messages.&lt;/p&gt;
&lt;p&gt;If they have a filesystem on them, and your desktop mounts them automatically, like GNOME or KDE will traditionally do, then you&amp;#8217;ll need to unmount the devices. Once unmounted, we&amp;#8217;ll need to partition the devices, and label the partitions as &amp;#8220;Linux LVM&amp;#8221;. I&amp;#8217;ll leave that step up to you. Some good utilities of making this happen are fdisk, sfdisk or parted. You will only need one partition on each drive. Make sure the partition covers the whole disk, and make sure the partition is labeled as &amp;#8220;Linux LVM&amp;#8221;. If the partition is not labeled appropriately, it could cause problems for you later down the road.&lt;/p&gt;
&lt;p&gt;Now that you have your disks partitioned, and labeled correctly, let&amp;#8217;s start building the LVM structure. This is done by creating physical volumes first, then adding them to a disk pool, and chopping up the disk pool as needed for our mount points. &lt;strong&gt;Caution: This next step will erase any filesystem, and as a result, any data on the drives.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pull up a terminal, type as root, and pay attention to the output:&lt;/p&gt;
&lt;pre&gt;# pvcreate /dev/sd{y,z}1
  Physical volume "/dev/sdy1" successfully created
  Physical volume "/dev/sdz1" successfully created
&lt;/pre&gt;
&lt;p&gt;Now, time to add these two physical volumes to a drive pool. This next step is important, because you will give a name to the volume group. &lt;strong&gt;This name must be unique!&lt;/strong&gt; Reason being: if you take this LVM structure to another computer, and it already has LVM implemented with a volume group that has the same name as yours, you&amp;#8217;ll run into snags. So, for me, I used my GnuPG keyID. I figure that will be unique enough, that I shouldn&amp;#8217;t encounter it on any computers I plan on using this with. But, you can name it whatever you want. Name it something that is useful to you. Of course, name it something very unique.&lt;/p&gt;
&lt;p&gt;So, continuing in your terminal, type as root and watch the output:&lt;/p&gt;
&lt;pre&gt;# vgcreate 8086060F /dev/sd{y,z}1
  Volume group "8086060F" successfully created&lt;/pre&gt;
&lt;p&gt;Cool, at this point, I have about 64MB of space that I can chop up any way I see fit. Maybe I want a 50MB volume and a 14MB volume. Maybe I want one massive 64MB volume. Maybe I want 64 1MB volumes. The point is, you decide. When I create my logical volumes, I&amp;#8217;ll be using the &amp;#8220;lvcreate&amp;#8221; command, which is rather detailed, so spending some time in the man pages will be of value.&lt;/p&gt;
&lt;p&gt;Before continuing, we need to find out exactly how much space I have in my pool. LVM is keeping some metadata on the disks, so I will be losing some space. But how much? This is important to know when I start creating my logical volumes. I can get this data by running the &amp;#8220;vgdisplay 8086060F&amp;#8221; command:&lt;/p&gt;
&lt;pre&gt;# vgdisplay 8086060F
  --- Volume group ---
  VG Name               8086060F
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               52.00 MB
  PE Size               4.00 MB
  Total PE              13
  Alloc PE / Size       0 / 0
  Free  PE / Size       13 / 52.00 MB
  VG UUID               F0pWrc-030s-03Uo-SoLl-7Tvf-ZETc-3hcxfG&lt;/pre&gt;
&lt;p&gt;&amp;#8220;Free PE/Size&amp;#8221; is what we&amp;#8217;re looking at. In this case, LVM is using 12MB of metadata stored on the disks for its operations. If each extent is 4MB and I have 52MB of space, then that means I have 13 physical extents that I can use. This is the &amp;#8220;PE&amp;#8221; number. So, I&amp;#8217;m going to use that number when creating my logical volume. I&amp;#8217;m also going to name it something personal; something that has some meaning to me. Because this will be holding my personal data, I&amp;#8217;ll name it &amp;#8220;personal&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Pull up a terminal, and as root:&lt;/p&gt;
&lt;pre&gt;# lvcreate -n personal -l 13 8086060F
  Logical volume "personal" created&lt;/pre&gt;
&lt;p&gt;Sweet! I have a logical volume that I can now put a filesystem on, mount, and start moving data to. So, let&amp;#8217;s get to it:&lt;/p&gt;
&lt;pre&gt;# mke2fs -j /dev/8086060F/personal
... [Output snipped] ..
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;/pre&gt;
&lt;p&gt;Next, let&amp;#8217;s mount it:&lt;/p&gt;
&lt;pre&gt;# mount /dev/8086060F/personal /mnt
# echo "Testing file on LVM" &gt; /mnt/file.txt&lt;/pre&gt;
&lt;p&gt;We now at this point have our LVM structure created, formated, mounted and data on it. Now, the key is to take these thumb drives out of the computer, take them to a separate computer, and rebuild the exact LVM structure keeping the data in tact. After all, that&amp;#8217;s what we&amp;#8217;re after, right? Mobile LVM?&lt;/p&gt;
&lt;p&gt;Unmount the device:&lt;/p&gt;
&lt;pre&gt;# umount /mnt&lt;/pre&gt;
&lt;p&gt;If you get an error here, run fuser, with its various options, to find why the umount is failing.&lt;/p&gt;
&lt;p&gt;Now with the logical volume unmounted, we need to deactivate it. This effectively takes the volume offline, so it can&amp;#8217;t be accessed for data retrieval or storage. This can be handled with the &amp;#8220;lvchange&amp;#8221; command. Looking at the man page, in order to activate or deactivate a logical volume, you need to pass the &amp;#8220;-a&amp;#8221; switch. &amp;#8220;-a y&amp;#8221; would activate it, and &amp;#8220;-a n&amp;#8221; would deactivate it.&lt;/p&gt;
&lt;p&gt;In your terminal:&lt;/p&gt;
&lt;pre&gt;# lvchange -a n /dev/8086060F/personal&lt;/pre&gt;
&lt;p&gt;No output will be there, but the device &amp;#8220;/dev/8086060F/personal&amp;#8221; should no longer exist. Now, we need to do the same thing with the volume group, telling LVM that we are finished with this group, and we no longer need its data. Surprise, surprise, this is done with the &amp;#8220;vgchange&amp;#8221; command, and we pass the same switch with its argument:&lt;/p&gt;
&lt;pre&gt;# vgchange -a n 8086060F
  0 logical volume(s) in volume group "8086060F" now active&lt;/pre&gt;
&lt;p&gt;At this point, it is safe to unplug the drives from your computer, and plug them into the new computer.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s typically best practice to notice how the Linux kernel identifies the drives when plugging them into a new machine. Knowing this information won&amp;#8217;t necessarily be of vital importance to us during this tutorial, but it could be of importance when troubleshooting. Let&amp;#8217;s say the kernel recognized the drives as /dev/sdk and /dev/sdl.&lt;/p&gt;
&lt;p&gt;At any event, we need to have LVM2 and Ext3 installed on this new machine, if they aren&amp;#8217;t already. Once those are installed, all we need to do is run pvscan to search the system for any new physical volumes. It should find our newly plugged in thumb drives, with all their metadata:&lt;/p&gt;
&lt;pre&gt;# pvscan
  PV /dev/sdk1   VG 8086060F   lvm2 [24.00 MB / 0    free]
  PV /dev/sdl1   VG 8086060F   lvm2 [28.00 MB / 0    free]
  Total: 2 [52.00 MB] / in use: 2 [52.00 MB] / in no VG: 0 [0   ]&lt;/pre&gt;
&lt;p&gt;Cool. It found them, and it&amp;#8217;s telling me that they belong to a volume group called &amp;#8220;8086060F&amp;#8221;. If this volume group already exists on the new computer, LVM will let me know. This is why we needed to create a new volume group that had a very unique name.&lt;/p&gt;
&lt;p&gt;All that&amp;#8217;s left, is to activate the volume group, then activate the logical volumes, and I should be able to mount the volume, and access the data. Let&amp;#8217;s give it a try:&lt;/p&gt;
&lt;pre&gt;# vgchange -a y 8086060F
  1 logical volume(s) in volume group "8086060F" now active&lt;/pre&gt;
&lt;p&gt;Sweet! So far so good. Notice too that I passed &amp;#8220;-a y&amp;#8221; to activate the group, where previously, I passed &amp;#8220;-a n&amp;#8221; to deactivate it. Now the logical volume:&lt;/p&gt;
&lt;pre&gt;# lvchange -a y /dev/8086060F/personal&lt;/pre&gt;
&lt;p&gt;No output, but can I mount it and access the data?&lt;/p&gt;
&lt;pre&gt;# mount /dev/8086060F /mnt
# cat /mnt/file.txt
Testing file on LVM&lt;/pre&gt;
&lt;p&gt;YES! WE DID IT! We&amp;#8217;ve rebuilt the LVM structure on a completely different computer, and our data remained untouched. At this point, I can modify, add, remove data on the LVM to my hearts content. When I&amp;#8217;m finished, as you&amp;#8217;re already aware, I can unmount the volume, deactivate the LV, deactivate the VG and remove the drives for the next computer.&lt;/p&gt;
&lt;p&gt;This process, as you have figured out, has quite a few steps to it, and it requires some knowledge about how LVM works. However, this pays off, I think, and it&amp;#8217;s rather straight forward.&lt;/p&gt;
&lt;p&gt;Not all is peaches and cream. You might have made a mistake during the process. Maybe you pulled out the drives before deactivating, and when you get to the new computer, it won&amp;#8217;t build the LVM structure, or something equally as troublesome. LVM keeps a cache on all it&amp;#8217;s operations in &amp;#8220;/etc/lvm/cache/.cache&amp;#8221;. You can safely remove this file, if it gets in your way. LVM will recreate it as necessary. That might fix your problem, it might not, but it&amp;#8217;s worth pointing out.&lt;/p&gt;
&lt;p&gt;I currently have 10 USB thumb drives, each of differing sizes as well as 3 mobile external hard disks. I&amp;#8217;ve got roughly 200GB of raw storage at my disposal. With just flat filesystems, I can&amp;#8217;t put down a 100GB file, unless I have a drive large enough to support it. The largest drive in my collection is a mere 80GB, so LVM fits the bill perfectly in making this possible, by combining all the disks. And because I can tear it down and rebuild it regardless of the computer I&amp;#8217;m sitting at, as long as LVM2 and the Ext3 filesystem are supported, I can access the data.&lt;/p&gt;
&lt;p&gt;Of course, you can choose any filesystem you want here. Just remember, however, that XFS does not support shrinking the filesystem. But, it&amp;#8217;s your drives, so do what you want.&lt;/p&gt;
&lt;p&gt;Further, if you really wanted to have fun, because you have multiple disks, you could totally take advantage of Linux software RAID. Because the structure we outlined above doesn&amp;#8217;t cover redundancy, if you lose a disk, your data could be corrupted. So, RAID would make sense, however, it complicates the mobility, by making sure Linux software RAID is also installed on the target machine, and it adds an extra step to activating the drives by rebuilding the RAID array first THEN rebuilding the LVs. And of course, if you&amp;#8217;re paranoid, you could add encryption on top of it with cryptesetup and LUKS. Again, though, another step getting to your data when tearing down and rebuilding. All thoughts for another post.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t care what you say, this is just too cool for school.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=QVdy_bclMuE:gUvezPk-ZDM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/QVdy_bclMuE" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/08/16/mobile-lvm/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://pthree.org/2009/08/16/mobile-lvm/</feedburner:origLink></entry><entry><title type="text">The Official Root Certified, LLC Launch!</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/bftNQesm810/" /><category term="Linux" /><author><name>Aaron</name></author><updated>2009-08-11T21:34:11-07:00</updated><id>http://pthree.org/?p=1096</id><summary type="html">Today is a big day. Christer Edwards and I have gone into business with each other starting a Linux and Unix company here in Utah. We&amp;#8217;re named &amp;#8220;Root Certified, LLC&amp;#8221;. We specialize in Linux hosting, Linux and Unix consulting and auditing. You can find more about us at our page: http://rootcertified.com.
If your company is looking [...]</summary><content type="html">&lt;p&gt;Today is a big day. &lt;a href="http://ubuntu-tutorials.com"&gt;Christer Edwards&lt;/a&gt; and I have gone into business with each other starting a Linux and Unix company here in Utah. We&amp;#8217;re named &amp;#8220;Root Certified, LLC&amp;#8221;. We specialize in Linux &lt;a href="http://rootcertified.com/managed-hosting/"&gt;hosting&lt;/a&gt;, Linux and Unix &lt;a href="http://rootcertified.com/consulting/"&gt;consulting&lt;/a&gt; and &lt;a href="http://rootcertified.com/audits/"&gt;auditing&lt;/a&gt;. You can find more about us at our page: &lt;a href="http://rootcertified.com"&gt;http://rootcertified.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If your company is looking for consulting or auditing in security, backups, virtualization, network services, troubleshooting or virtually anything else Linux or Unix reliated, we are the company for you! We can help you achieve industry standards, tighten your physical and network security, setup and configure all sorts of services and more. Further, we offer fully managed Linux hosting for your company or organization. You give us the data, and we do the rest. We have different packages for different needs, and our packages are completely flexible.&lt;/p&gt;
&lt;p&gt;And we&amp;#8217;re not stopping there! This is just the tip of the iceberg. We have some exciting new corporate expansions that we&amp;#8217;ll be working on in the near future that will engage the Free Software and Open Source communities, bring additional education to the masses, and overall increase Linux and Unix adoption in both the server and desktop markets.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re excited for what we can do for you. &lt;a href="http://rootcertified.com/about-us/"&gt;Contact us here&lt;/a&gt; to see how we can meet your needs.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=bftNQesm810:EjPRQTcynJg:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/bftNQesm810" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/08/11/the-official-root-certified-llc-launch/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://pthree.org/2009/08/11/the-official-root-certified-llc-launch/</feedburner:origLink></entry><entry><title type="text">It’s That Time Again</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/xe9KBjmQzmU/" /><category term="Personal" /><author><name>Aaron</name></author><updated>2009-06-09T05:12:55-07:00</updated><id>http://pthree.org/?p=965</id><summary type="html">1echo 'by9+IEhhcHB5IEJpcnRoZGF5IHRvIHlvdSEgSGFwcHkgQmlydGhkYXkgdG8geW91ISBZb3UgbG9vayBsaWtlIGEgbW9ua2V5LCBhbmQgeW91IGNvZGUgbGlrZSBvbmUgdG9vISBvL34K' &amp;#124; base64 -d</summary><content type="html">&lt;div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"&gt;&lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"&gt;&lt;div&gt;1&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;echo&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;'by9+IEhhcHB5IEJpcnRoZGF5IHRvIHlvdSEgSGFwcHkgQmlydGhkYXkgdG8geW91ISBZb3UgbG9vayBsaWtlIGEgbW9ua2V5LCBhbmQgeW91IGNvZGUgbGlrZSBvbmUgdG9vISBvL34K'&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; base64 &lt;span style="color: #660033;"&gt;-d&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=xe9KBjmQzmU:1ch4qjvKd_w:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/xe9KBjmQzmU" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/06/09/its-that-time-again/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">9</slash:comments><feedburner:origLink>http://pthree.org/2009/06/09/its-that-time-again/</feedburner:origLink></entry><entry><title type="text">GnuPG Up And Close</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/O0e382lSPBQ/" /><category term="Cryptology" /><category term="Linux" /><category term="Security" /><author><name>Aaron</name></author><updated>2009-06-08T23:09:15-07:00</updated><id>http://pthree.org/?p=1069</id><summary type="html">Every GNU/Linux distribution ships with GnuPG by default. While they all don&amp;#8217;t ship with the same GUI frontend, they do ship with the the same CLI backend. So, we&amp;#8217;ll be interfacing with that throughout this informational session. I&amp;#8217;m not presenting this as anything necessarily useful. Rather, I hope you find it informational/educational, and learn a [...]</summary><content type="html">&lt;p&gt;Every GNU/Linux distribution ships with GnuPG by default. While they all don&amp;#8217;t ship with the same GUI frontend, they do ship with the the same CLI backend. So, we&amp;#8217;ll be interfacing with that throughout this informational session. I&amp;#8217;m not presenting this as anything necessarily useful. Rather, I hope you find it informational/educational, and learn a little bit with how GnuPG works &amp;#8220;under the hood&amp;#8221;. So, let&amp;#8217;s have some fun. First, a list of the &amp;#8220;standard&amp;#8221; algorithms that ship with GnuPG on a GNU/Linux system. This is completely based on the type of main public and private keys as well as any subkeys that you&amp;#8217;ve generated. You can see a list of supported cipher, digest and compression algorithms by invoking the gpg binary and passing &amp;#8220;&amp;#8211;version&amp;#8221; as an option. For example, here is the output from my Debian GNU/Linux unstable laptop:&lt;/p&gt;
&lt;pre&gt;$ gpg -v --version
gpg (GnuPG) 1.4.9
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES (S2), CAST5 (S3), BLOWFISH (S4), AES (S7), AES192 (S8),
        AES256 (S9), TWOFISH (S10)
Hash: MD5 (H1), SHA1 (H2), RIPEMD160 (H3), SHA256 (H8), SHA384 (H9),
      SHA512 (H10), SHA224 (H11)
Compression: Uncompressed (Z0), ZIP (Z1), ZLIB (Z2), BZIP2 (Z3)&lt;/pre&gt;
&lt;p&gt;So, for ciphers, I support 3DES, CAST5, BLOWFISH, AES, AES192, AES256 and BLOWFISH. For digest hashes, I support MD5, SHA1, RIPEMD160, SHA224, SHA256, SHA384 and SHA512. Lastly, for compression algorithms, I support uncompressed, ZIP, ZLIB and BZIP2. Your output my vary slightly one way or the other. For example, you may not see the full suite of SHA algorithms. This can be obtained by generating an RSA subkey for signing only. Other ciphers might include IDEA, CAMELLIA128, CAMELLIA192 and CAMELLIA256, and you could have TIGER and WHIRLPOOL as possible supported hashes.&lt;/p&gt;
&lt;p&gt;With all these algorithms, how do you know which to use and when? Fortunately, GnuPG takes care of that for you automatically. However, you can tell it what you would to prefer to use for each, if you like. You can set these in your ~/.gnupg/gpg.conf file. The options you are looking to set are &amp;#8220;default-preference-list&amp;#8221;, &amp;#8220;personal-cipher-preferences&amp;#8221;, &amp;#8220;personal-digest-preferences&amp;#8221; and &amp;#8220;personal-compress-preferences&amp;#8221;. For myself, here is what I have set in my gpg.conf:&lt;/p&gt;
&lt;pre&gt;default-preference-list 3DES CAST5 BLOWFISH AES AES192 AES256 TWOFISH MD5 SHA1 RIPEMD160 SHA224 SHA256 SHA384 SHA512 Uncompressed ZIP ZLIB BZIP2
personal-cipher-preferences TWOFISH AES256 AES192 AES BLOWFISH CAST5 3DES
personal-digest-preferences SHA512 SHA384 SHA256 SHA224 SHA1 RIPEMD160 MD5
personal-compress-preferences BZIP2 ZLIB ZIP Uncompressed&lt;/pre&gt;
&lt;p&gt;Now, when we printed out the verbose version, we saw in parenthesis S2, S3, H8, H9, Z1, Z2 and so on. We can use these instead of the name in our gpg.conf if we so wish. I prefer the name, as I can&amp;#8217;t recall the key to the algorithm, and it&amp;#8217;s easier to read. So, in my case, I list out everything that I want for a default list of preferences, then I choose the order of which to pick from when encrypting, signing and compressing. So, for encryption, I have set TWOFISH as my first choice, with AES256 as my second choice, then AES192 as my third, and so forth. I&amp;#8217;ve done the same with my preferred digest hashing algorithm choosing SHA512 first, then SHA384 second, and so on, and the same with compression.&lt;/p&gt;
&lt;p&gt;Why set the preference? For starters, if you&amp;#8217;re like me, you sign all your email by default. You probably want your signature to withstand the test of time as long as possible. Given the strength of today&amp;#8217;s hardware, why not choose the strongest encryption and hash algorithms? But on a more practical note, if you&amp;#8217;re encrypting data to yourself, this would tell GnuPG to use TWOFISH as the encryption algorithm. This means that if you want to decrypt it at a later date, maybe on another computer, you&amp;#8217;ll need to make sure TWOFISH is compiled into GnuPG. How would you know what was used? We&amp;#8217;ll cover that in a bit.&lt;/p&gt;
&lt;p&gt;However, what about encrypting to someone else other than yourself? How do these preferences come into play? Well, you can also set preferences in your public key. The purpose of this, is when people grab a copy of your key, and they want to encrypt something to you, GnuPG will negotiate the first preferred algorithm that is common between the two end points (the one doing the encrypting and the one receiving the encrypted data).&lt;/p&gt;
&lt;p&gt;For example, let&amp;#8217;s suppose Alice has a GnuPG keypair as does Bob. In Alice&amp;#8217;s public key, which Bob has a legitimate copy of, she has set a cipher preference order of: TWOFISH BLOWFISH AES CAST5 and 3DES. Bob wants to encrypt data to Alice. Because he has a copy of her public key, he can do this. The question here is, which algorithm will be chosen for the encryption? Well, Alice prefers TWOFISH as a first pick. If Bob has compiled TWOFISH support in his copy of GnuPG, then it will be used. Suppose he doesn&amp;#8217;t have TWOFISH support. Then the next preferred algorithm is BLOWFISH, because it&amp;#8217;s Alice&amp;#8217;s second pick. Let&amp;#8217;s say Bob does support it, then BLOWFISH is the algorithm used for encrypting the data to Alice. When Alice receives the encrypted data, she&amp;#8217;ll use the BLOWFISH algorithm along with her private key to decrypt the data. Should she wish to reply, her copy of GnuPG will pull out the preferences from Bob&amp;#8217;s public key, and go through the same process looking for the first preferred algorithm by Bob that is supported by both parties. The &amp;#8220;SSL handshake&amp;#8221; works much in this same manner.&lt;/p&gt;
&lt;p&gt;Digest hashing works much the same way, but slightly different. Because the recipient doesn&amp;#8217;t matter with signed data, then rather than looking to public keys for the digest algorithm preference, you turn to your gpg.conf file, if listed, and use that there. If the recipient, or recipients have a copy of your public key, &lt;em&gt;and&lt;/em&gt; the same digest algorithm compiled into their copy of GnuPG, they can verify your signature. If either is missing, the public key, or the algorithm, the signature will fail, and GnuPG will explain the problem. This process is the same for compression algorithms.&lt;/p&gt;
&lt;p&gt;So, we&amp;#8217;ve made the preferences in our gpg.conf, but how do we set them in the public key, so we can distribute this to others? Well, in this case, we need to edit our key. From the terminal (I&amp;#8217;ve snipped out the noise, focusing only on what&amp;#8217;s important):&lt;/p&gt;
&lt;pre&gt;$ gpg --edit-key KEYID
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.
[ ... SNIP ... ]

Command&amp;gt;&lt;/pre&gt;
&lt;p&gt;We are now sitting at a command prompt that we can use to pass commands in an interactive fashion. I should mention that all this can be done non-interactively. Checking out the gpg manual will provide the list of options for making this possible. Typing &amp;#8220;help&amp;#8221; will give us the list of commands that we can pass:&lt;/p&gt;
&lt;pre&gt;Command&amp;gt; help
[... SNIP ...]
pref        list preferences (expert)
showpref    list preferences (verbose)
setpref     set preference list for the selected user IDs
[... SNIP ...]&lt;/pre&gt;
&lt;p&gt;The commands that we are interested in &amp;#8220;pref&amp;#8221; and &amp;#8220;setpref&amp;#8221;. Passing &amp;#8220;pref&amp;#8221; might give us something like the following:&lt;/p&gt;
&lt;pre&gt;Command&amp;gt; pref
[ultimate] (1). Aaron &amp;lt;aaron@example.com&amp;gt;
     S10 S9 S8 S7 S4 S3 S2 H10 H9 H8 H11 H2 H3 H1 Z3 Z2 Z1 Z0 [mdc] [no-ks-modify]&lt;/pre&gt;
&lt;p&gt;See those algorithm codes we saw at the beginning of this tutorial? They are listed in the preferred order that we wish to have each algorithm. In my case, I have all my encryption algorithms lists, from strong to weak, then hashing from strong to weak, then compression from most tight to no compression. What if I wanted to set a different order, or maybe not include some preferences: Using &amp;#8220;setpref&amp;#8221; makes this possible:&lt;/p&gt;
&lt;pre&gt;Command&gt; setpref S10 S9 S8 S7 H10 H9 H8 H2 H3 Z2 Z1 Z3 Z0
Set preference list to:
     Cipher: TWOFISH, AES256, AES192, AES, 3DES
     Digest: SHA512, SHA384, SHA256, SHA1, RIPEMD160
     Compression: ZLIB, ZIP, BZIP2, Uncompressed
     Features: MDC, Keyserver no-modify
Really update the preferences? (y/N)&lt;/pre&gt;
&lt;p&gt;Typing &amp;#8220;y&amp;#8221; will of course make the setting in your key. At this point, you&amp;#8217;ll be asked to enter your private key passphrase successfully before continuing. At that point, it will be statically set in your public key, and you can send your key off to the keyservers and emailed to your family and friends, so they can immediately start taking advantage of the new preferences. Type &amp;#8220;quit&amp;#8221; to leave the prompt.&lt;/p&gt;
&lt;p&gt;Now, let&amp;#8217;s say you have some signed and encrypted data, and you&amp;#8217;re curious of the algorithms used when creating the cipher text. This can be done by passing the &amp;#8220;&amp;#8211;list-packets&amp;#8221; option to gpg to see the data packets. We&amp;#8217;ll need to turn on verbosity as well. For example, the output of a file I sent to a friend using the Mutt email client (emphasis mine):&lt;/p&gt;
&lt;pre&gt;gpg -v --list-packets file.txt
gpg: armor header: Version: GnuPG v2.0.11 (GNU/Linux)
[... SNIP ...]
&lt;b&gt;gpg: AES256 encrypted data&lt;/b&gt;
&lt;b&gt;:compressed packet: algo=3&lt;/b&gt;
&lt;b&gt;&amp;#58;onepass_sig packet&lt;/b&gt;: keyid CE7911B7FC04088F
	version 3, sigclass 0x01, &lt;b&gt;digest 8&lt;/b&gt;, pubkey 1, last=1
:literal data packet:
	mode t (74), created 1244484492, name="mutt-helios-1000-24974-13",
	raw data: unknown length
&lt;/pre&gt;
&lt;p&gt;Here, I can easily see that AES256 was used for the encryption algorithm, but what&amp;#8217;s this compressed &amp;#8220;algo=3&amp;#8243; and &amp;#8220;onepass_sig packet digest 8&amp;#8243; stuff? Well, in order to understand those, we need to turn to &lt;a href="http://www.faqs.org/rfcs/rfc4880.html"&gt;RFC 4880&lt;/a&gt;. This RFC describes the OpenPGP message format and the standards used. Browse your way down to section 9, and you&amp;#8217;ll see what &amp;#8220;algo=3&amp;#8243; means for compression and &amp;#8220;digest 8&amp;#8243; is for signatures. It appears, according to that RFC, that BZIP2 was used for compression and SHA256 was used for the hashing algorithm. So, in this case, Christer and myself preferred those settings higher than the others, and my GnuPG acknowledged those preferences and did the encrypting, signing and compressing as told. We can see these by &amp;#8220;editing&amp;#8221; his key:&lt;/p&gt;
&lt;pre&gt;$ gpg --edit-key christer
[... SNIP ...]
Command&amp;gt; pref
[  full  ] (1). Christer &amp;lt;christer@example.com&amp;gt;
     S9 S8 S7 S3 S2 H2 H8 H3 Z2 Z3 Z1 [mdc] [no-ks-modify]
[... SNIP ...]

Command&amp;gt; quit&lt;/pre&gt;
&lt;p&gt;Christer places AES256 has his first preferred encryption algorithm. Because I also support this algorithm, this is used for the encryption. SHA1 is his preferred digest hashing algorithm with SHA256 as his second preferred, but remember that for the signature and compression, these preferences are found in my gpg.conf instead. I prefer SHA512 as my first preference, but he doesn&amp;#8217;t list it as suported (according to his public key), so I move down to SHA384. Again, he doesn&amp;#8217;t list it, so I try SHA256. He lists it, so it&amp;#8217;s used. Lastly, BZIP2 as the compression algorithm, and he lists it, thus it&amp;#8217;s chosen. Thus, the results we got. Make sense?&lt;/p&gt;
&lt;p&gt;I hope this has been informative. It&amp;#8217;s been great discovering the details of how these algorithms were chosen, and it&amp;#8217;s been fun playing with all sorts of encrypted emails and files to get to the guts of the GunPG process. If I&amp;#8217;ve misrepresented any data here, or you have questions, please let me know.&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=O0e382lSPBQ:bOyVz1JdVq4:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/O0e382lSPBQ" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/06/08/gnupg-up-and-close/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://pthree.org/2009/06/08/gnupg-up-and-close/</feedburner:origLink></entry><entry><title type="text">Password Policies Suck</title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/pthree/~3/hNmnZUNcjAs/" /><category term="Linux" /><category term="Scripting" /><author><name>Aaron</name></author><updated>2009-05-28T15:06:40-07:00</updated><id>http://pthree.org/?p=1062</id><summary type="html">I&amp;#8217;ve been getting a flurry of emails at work, reminding me that my passwords are about to expire on several Unix and Linux machines in our production datacenter. They have a policy in place, where the password much be changed every 90 days, and I have to keep my current password for at least 7 [...]</summary><content type="html">&lt;p&gt;I&amp;#8217;ve been getting a flurry of emails at work, reminding me that my passwords are about to expire on several Unix and Linux machines in our production datacenter. They have a policy in place, where the password much be changed every 90 days, and I have to keep my current password for at least 7 before changing it, and I can&amp;#8217;t use any password that has been used previously, let alone, the insane requirements for the password. So, rather than fight it, I thought I would make this easy on myself.&lt;/p&gt;
&lt;p&gt;First, I&amp;#8217;m a big fan of SSH key authentication. Because I&amp;#8217;m allowed to use SSH authentication, I have my public SSH key on all the servers in the datacenter. When my password is about to expire, I get an email notice once per day two weeks in advance. I can use this email as an opportunity to execute a script that will change all the passwords on all the servers for me. In the script, I&amp;#8217;ll have it grab some data from /dev/urandom, and create a sha1sum of the input. An encrypted version of the hash will then be saved locally to disk, which will be encrypted with my GnuPG key, and emailed to myself, should I need the password for something other than SSH. Lastly, just so the password can&amp;#8217;t be compromised, only the encrypted versions of the password remain on disk. The hashes themselves are shell variables that are cleared when the script exits. Further, I&amp;#8217;ve changed the permissions on my home directory, where my SSH keys and GnuPG keys exist, such that everything sensitive is only accessible to myself. I realize that convenience comes at the sacrifice of a bit of security. My laptop is running full disk encryption, and my password to guard my account is strong. I am the only one on my machine, and I expect it to stay that way. As such, I&amp;#8217;m not worried about anything getting compromised.&lt;/p&gt;
&lt;p&gt;All of this is stored in a simple shell script, shown below. You will need the &amp;#8220;expect&amp;#8221; and &amp;#8220;sha1sum&amp;#8221; packages installed on your system before executing this script. You will need a GnuPG key pair generated for encrypting and decrypting data. You&amp;#8217;ll need SSH keys created and distributed to each server beforehand. You should probably have your SSH keys added to your SSH agent, as well as your GnuPG key added to a GPG agent before executing the script, to save you some serious typing. I won&amp;#8217;t cover that here, but Seahorse is a great utility for managing GPG and SSH keys. Of course, your SSH keys and GPG keys should be passphrase protected.&lt;/p&gt;
&lt;div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"&gt;&lt;table cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"&gt;&lt;div&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7&lt;br /&gt;8&lt;br /&gt;9&lt;br /&gt;10&lt;br /&gt;11&lt;br /&gt;12&lt;br /&gt;13&lt;br /&gt;14&lt;br /&gt;15&lt;br /&gt;16&lt;br /&gt;17&lt;br /&gt;18&lt;br /&gt;19&lt;br /&gt;20&lt;br /&gt;21&lt;br /&gt;22&lt;br /&gt;23&lt;br /&gt;24&lt;br /&gt;25&lt;br /&gt;26&lt;br /&gt;27&lt;br /&gt;28&lt;br /&gt;29&lt;br /&gt;30&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;td&gt;&lt;div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"&gt;&lt;span style="color: #666666; font-style: italic;"&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# License: public domain&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;if&lt;/span&gt; &lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#91;&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#91;&lt;/span&gt; &lt;span style="color: #660033;"&gt;-f&lt;/span&gt; newpass.gpg &lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#93;&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#93;&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;then&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #c20cb9; font-weight: bold;"&gt;mv&lt;/span&gt; &lt;span style="color: #660033;"&gt;-f&lt;/span&gt; newpass.gpg oldpass.gpg&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #007800;"&gt;OLDPASSWD&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;&lt;span style="color: #007800;"&gt;$(gpg -d oldpass.gpg)&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;fi&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# Change &amp;quot;Your Name&amp;quot; to fit the user ID that matches in your GPG key&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c20cb9; font-weight: bold;"&gt;dd&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;if&lt;/span&gt;=&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;dev&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;urandom &lt;span style="color: #007800;"&gt;count&lt;/span&gt;=100 2&lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;dev&lt;span style="color: #000000; font-weight: bold;"&gt;/&lt;/span&gt;null &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; sha1sum &lt;span style="color: #660033;"&gt;-b&lt;/span&gt; - &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; \&lt;br /&gt;
gpg &lt;span style="color: #660033;"&gt;-ar&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;&amp;quot;Your Name&amp;quot;&lt;/span&gt; &lt;span style="color: #660033;"&gt;-e&lt;/span&gt; - &lt;span style="color: #000000; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt; newpass.gpg&lt;br /&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# Change &amp;quot;username@domain.tld&amp;quot; to match the email you wish to send this to&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #c20cb9; font-weight: bold;"&gt;cat&lt;/span&gt; newpass.gpg &lt;span style="color: #000000; font-weight: bold;"&gt;|&lt;/span&gt; mail &lt;span style="color: #660033;"&gt;-s&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;&amp;quot;Password for servers&amp;quot;&lt;/span&gt; username&lt;span style="color: #000000; font-weight: bold;"&gt;@&lt;/span&gt;domain.tld&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #007800;"&gt;NEWPASSWD&lt;/span&gt;=&lt;span style="color: #ff0000;"&gt;&amp;quot;&lt;span style="color: #007800;"&gt;$(gpg -d newpass.gpg)&lt;/span&gt;&amp;quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# Change &amp;quot;server1 server2 sever3&amp;quot; to match the hostnames of the servers you'll loop over&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #666666; font-style: italic;"&gt;# Change &amp;quot;domain.tld&amp;quot; to match the FQDN for your servers&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; host &lt;span style="color: #000000; font-weight: bold;"&gt;in&lt;/span&gt; server1 server2 server3; &lt;span style="color: #000000; font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #007800;"&gt;EXPECT&lt;/span&gt;=$&lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#40;&lt;/span&gt;expect &lt;span style="color: #660033;"&gt;-c&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;&amp;quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spawn ssh &lt;span style="color: #007800;"&gt;$host&lt;/span&gt;.domain.tld&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;passwd&lt;span style="color: #000099; font-weight: bold;"&gt;\r&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; expect &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;(current) UNIX password: &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;span style="color: #007800;"&gt;$OLDPASSWD&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\r&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; expect &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;New UNIX password: &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;span style="color: #007800;"&gt;$NEWPASSWD&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\r&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; expect &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;Retype new password: &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send &lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;span style="color: #007800;"&gt;$NEWPASSWD&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\r&lt;/span&gt;&lt;span style="color: #000099; font-weight: bold;"&gt;\&amp;quot;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;quot;&lt;/span&gt;&lt;span style="color: #7a0874; font-weight: bold;"&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style="color: #7a0874; font-weight: bold;"&gt;echo&lt;/span&gt; &lt;span style="color: #007800;"&gt;$EXPECT&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #000000; font-weight: bold;"&gt;done&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Initially, when I started writing this script, I wanted it to run in cron locally on my laptop. As I began building the script, I realized this wasn&amp;#8217;t a secure move, for a couple of reasons. First, as already mentioned, I&amp;#8217;m using SSH authentication using public key cryptography. All of my SSH keys are passphrase protected. I didn&amp;#8217;t want to store the passphrase in the script, so I could automate the process, and I didn&amp;#8217;t want to remove the passphrase or generate new keys that didn&amp;#8217;t have a passphrase. Further, wanting to encrypt the data, and send it to myself via email required that I store my GnuPG passphrase on disk as well. I didn&amp;#8217;t like this idea either, as I&amp;#8217;m already storing the new and old encrypted passwords on disk from the script, and that&amp;#8217;s enough. No need to compromise security any further. So, I&amp;#8217;ll run this script by hand.&lt;/p&gt;
&lt;p&gt;However, we have a problem. You will be typing passphrases galore in this script if you have a decent number of hosts to loop through. So, as mentioned, it would probably be best to take advantage of an SSH and GPG agent to cache your passphrases to ease the pain before executing the script.&lt;/p&gt;
&lt;p&gt;Looking over the script a bit. First thing to note, is it is sending the same password to every server. You might not want this. If so, feel free to modify the script to fit your needs. Second, the sha1sum hash is never stored on disk. Rather, it&amp;#8217;s just stored in variables OLDPASS and NEWPASS. The idea between the old passwords and the new passwords, is so we can provide the current password when updating, as well as the old.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;re pulling from /dev/urandom as a source for semi-random data. Yes, you can pull from /dev/random if it makes you sleep better at night. Also, we&amp;#8217;re not pulling a lot of data, because ultimately, the SHA1 hash will be strong enough as it is. You&amp;#8217;ll notice too that because we&amp;#8217;re using STDIN for our data source, the hash contains a space, asterisk and hyphen following the hash, and we&amp;#8217;re keeping it. I figured no reason to remove it, as spaces, asterisks and hyphens are valid UNIX password characters. If your company has a more draconian password policy than mine does, requiring specifically more than say 3 or 5 non-alphanumeric characters, then just append those to the end of hash before encrypting to disk. Maybe something like the string &amp;#8220;!@#$%&amp;#8221;.&lt;/p&gt;
&lt;p&gt;Lastly, we&amp;#8217;re emailing the encrypted password to ourselves, so no worries about compromising there, plus that gives us an extra backup in case we lose our disk that is storing the encrypted passwords. This also gives flexibility to where we can retrieve the password, provided we have access to the Internet and our GPG keys. Then we&amp;#8217;re using &amp;#8220;expect&amp;#8221; to send the passwd command to the server and send our old and new passwords as prompted for each server. You might need to change the expected prompt depending on your GNU/Linux or Unix derivative (&amp;#8220;New RedHat password: &amp;#8221; for example).&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it! Simple enough. If you have any questions, or improvements, please post them in the comments. Thanks!&lt;/p&gt;
&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pthree?a=hNmnZUNcjAs:HjGm00bpkgA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pthree?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pthree/~4/hNmnZUNcjAs" height="1" width="1"/&gt;</content><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://pthree.org/2009/05/28/password-policies-suck/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">4</slash:comments><feedburner:origLink>http://pthree.org/2009/05/28/password-policies-suck/</feedburner:origLink></entry></feed>
