<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jordaneunson.com</title>
	<atom:link href="http://jordaneunson.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://jordaneunson.com</link>
	<description>I make/break/fix stuff</description>
	<lastBuildDate>Wed, 25 Aug 2010 15:04:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub'"/>		<item>
		<title>Magic Triangle Setup with Windows File Server backed Portable Home Directories.</title>
		<link>http://jordaneunson.com/?p=758</link>
		<comments>http://jordaneunson.com/?p=758#comments</comments>
		<pubDate>Wed, 25 Aug 2010 00:38:50 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Active]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[Home Directories]]></category>
		<category><![CDATA[Open]]></category>
		<category><![CDATA[Open Directory]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[Windows File Server]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=758</guid>
		<description><![CDATA[Recently I was hired to give my opinion about merging an existing Macintosh Open Directory(OD) network into a Windows Active Directory(AD) network. This was being done because Company A merged with Company B, and Company B being more powerful and larger wanted to stay with their AD infrastructure. My opinion was to move to a [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=758" type="box_count"></fb:share-button><p><a href="http://jordaneunson.com/wp-content/uploads/2010/08/bill-gates-and-steve-jobs-d5-interview.jpg"><img class="alignleft size-medium wp-image-761" title="BFFs" src="http://jordaneunson.com/wp-content/uploads/2010/08/bill-gates-and-steve-jobs-d5-interview-300x207.jpg" alt="" width="300" height="207" /></a>Recently I was hired to give my opinion about merging an existing Macintosh Open Directory(OD) network into a Windows Active Directory(AD) network. This was being done because Company A merged with Company B, and Company B being more powerful and larger wanted to stay with their AD infrastructure. My opinion was to move to a &#8220;Magic Triangle&#8221; setup where an OD server is bound to an AD Domain Controller(DC). The users and groups are managed by Active Directory, however the Mac clients are bound to both AD and OD for the purpose of being able to hand out MCX records to users, groups, and computers. I wrote this how to because no matter how much documentation I read I have not been able to find some of the key pieces of information I needed to accomplish this goal. On a side note, I would like to give a big hello to Alper Bac, current Systems Administrator of Cohos Evamy for his invaluable help in solving some of the AD configuration issues we were having.</p>
<h3>On the Mac Server 10.6</h3>
<p><strong>Step 1:</strong> Check the Active Directory configuration.<br />
Make sure your Active Directory server and its DNS service is properly configured and running.</p>
<p><strong>Step 2:</strong> Turn on Open Directory service.<br />
Use Server Admin to turn the Open Directory service on. After the service is turned on you can configure Open Directory service settings.</p>
<p><strong>Step 3:</strong> Ensure the computer is a standalone directory service.</p>
<p><strong>Step 4: </strong>Connect to Active Directory.</p>
<ul>
<li>Go to Server Admin, Open Directory.</li>
<li>Click Settings button at top, then the General tab. The window should report that its role is “Standalone Directory.” If this is correct you can now click change, otherwise go to Step 3.</li>
<li>In the pop-up dialogue choose “Connect to another Directory”</li>
<li>Then Continue, and click “Open Directory Utility”</li>
<li>The Directory Utility application will appear. If it is locked please unlock it.</li>
<li>Ensure that active directory is uncheck</li>
<li>Double click “Active Directory”</li>
<li>Type in your domain and expand the arrow beside “Show Advanced Options”</li>
<li>Ensure that “Create mobile account at login” and “Force Local home directory on startup disk” is uncheck. Then click OK</li>
<li>Quit Directory Utility</li>
<li>Back in the Open Directory Wizard box click Done</li>
<li>Open System Preferences and go to Accounts</li>
<li>Click on Login Options and Click “Join”</li>
<li>Type the name of Active Directory Domain Controller (DC) in where it says “Server:” as well as the AD Admin user/password credentials in the appropriate boxes. Also give the computer an record name. This name will be the record that is created in Active Directory.</li>
<li>Once joined the Mac will ask about Kerberos. Just ignore this for now.</li>
</ul>
<p><strong>Step 5:</strong> Set up an Open Directory master.</p>
<ul>
<li>Go to Server Admin, Open Directory</li>
<li>Click Settings button at top, then the General tab. The window should report that its role is “Connected to another directory” If this is correct you can now click change, otherwise go to Step 4.</li>
<li>Choose the first option “Remain connected and set up an Open Directory Master”</li>
<li>If it complains about Kerberos just ignore this again.</li>
<li>Setup the diradmin account. Give it a secure password as this is our Directory Administrator account.</li>
<li>Now type in a relevant LDAP Search Base. If you don’t know what should go here just click continue. However if you don’t know what goes here yet you’re trying to integrate a Mac into AD I must say that you may be in over your head. <img src='http://jordaneunson.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>Confirm your settings and click continue.</li>
<li>Now in Server Admin we want to set a policy under Open Directory. So click on Policies tab and then Bindings subtab and enable the “Require authenticated binding&#8230;.” check box.</li>
</ul>
<p><strong>Step 6:</strong> Disable Kerberos on Open Directory master.<br />
Disable Kerberos on your Open Directory Master server to avoid conflicts with your Active Directory Kerberos realm. In a terminal type: (use the diradmin credentials)<br />
<code>sudo sso_util remove -k -a username -p password -r NAME. OF.KERBEROSREALM</code></p>
<p><strong>Step 7:</strong> Kerberize services.<br />
Kerberize your Open Directory server services with the Kerberos realm of your Active Directory server, in a terminal type:<br />
<code>sudo dsconfigad -enablesso</code></p>
<h3>On the Windows Server 2003</h3>
<p>What we need to do is assign a home folder to an existing user account. So let’s grab the user account “Test” and map a home folder to it.</p>
<ul>
<li>Go to Start, Administrative Tool, Active Directory Users and Computers</li>
<li>Right click domain name and search for users</li>
<li>Open Properties and then profile tab</li>
<li>Click the “home folder” radio button and select an unused drive letter. For our example it will be “Z:” and then enter beside it the Windows File server fqdn in this format. \\fqdn\share\username</li>
<li>Once you accept Windows will go and create this folder and assign all the appropriate ACLs</li>
</ul>
<h3>On the Mac Client 10.5</h3>
<p>What we need to do on the Mac client is bind it to both AD and OD.</p>
<p><strong>Active Directory</strong></p>
<ul>
<li>Login as a the local admin user</li>
<li>Open Applications/Utilities/Directory Utility.app</li>
<li>Click on “Services” and then double click “Active Directory”</li>
<li>Expand the Show Advanced Options arrow and disable “Force local home directory on startup disk”</li>
<li>Now click on “Directory Servers” and click on “+”</li>
<li>From the drop down select “Active Directory” and type the name of the DC</li>
<li>Enter the computer ID and AD username/password and click join.</li>
<li>If this fails then try clicking on Services and double click on Active Directory</li>
<li>Type in the domain and client ID here and click “Bind”</li>
</ul>
<p><strong>Open Directory</strong></p>
<ul>
<li>Open Applications/Utilities/Directory Utility.app</li>
<li>Click “+” and select “Open Directory” from the drop down menu</li>
<li>Type in the name of the ODM</li>
<li>The computer should ask you for the OD diradmin password and client ID. Type in the same ID as you did for the Windows box (for consistency’s sake)</li>
</ul>
<p>Now you should have two directory servers listed in the Directory Utility both with green lights.</p>
<p>You should now have a working Magic Triangle. The user and group accounts come from Active Directory and their home folders come from a Windows back File Server. We can now use WGM to introduce things like Portable Home Directories and MCX records. Yay!</p>
<h3>Portable Home Directories</h3>
<ul>
<li> Open WGM (WorkGroup Manager) and authenticate as diradmin</li>
<li> Create a new group called “Mobility” we’re going to use this group to designate PHD users.</li>
<li> Under the members tab click on the Plus sign, a side bar should appear.</li>
<li> At the top of the side bar will be a text string like “Directory: /LDAPv3/127.0.0.1” click on this and change it to “/Active Directory/All Domains”</li>
<li> Wait up to a couple minutes and you will start to see users from Active Directory appears. You can drag these users into the members pane of WGM. AFAIK you can also embed AD groups although I’ve never tried this.</li>
<li> Now we have an OD group with an AD user member as well as a computer record from the mac client.</li>
<li> Let’s click on Preferences for the mobility group and then click on “Mobility” under Overview tab.</li>
<li> Under account creation tab click on “Always” and check “Create mobile account when user logs into network account” a</li>
<li> Then click on rules tab and select always for all three subtabs yet leave their default values. Except for checking on “Show status in menu bar” under “options” sub tab</li>
<li> Now try logging in with your AD account again and watch as the mac creates you a PHD and enables the HomeSync menu.</li>
<div><span style="font-family: Helvetica, 'Times New Roman', 'Bitstream Charter', Times, serif; color: #1a1a18; font-size: x-small;"><br />
</span></div>
</ul>
<p>If you have problems with this process then feel free to leave a comment with some contact info and I&#8217;ll try to get back to you and help. I&#8217;ll have another post coming up for you Windows Sysadmins on how to easily managed your mac clients with Group Policy. </p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=758&title=Magic Triangle Setup with Windows File Server backed Portable Home Directories.&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=758" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=758</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vacation Time</title>
		<link>http://jordaneunson.com/?p=752</link>
		<comments>http://jordaneunson.com/?p=752#comments</comments>
		<pubDate>Mon, 19 Jul 2010 19:46:31 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=752</guid>
		<description><![CDATA[So this going to be my last post for a while. Probably till the end of summer. I&#8217;m going on a european vacation with my lady. It&#8217;s going to be an epic adventure full of battles, conquests, and amazing sites. If you want to follow our adventure please check out our new tumblr blog. 




]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=752" type="box_count"></fb:share-button><p><div id="attachment_753" class="wp-caption alignleft" style="width: 310px"><a href="http://jordaneunson.com/wp-content/uploads/2010/07/sardinia_wideweb__430x326.jpg"><img src="http://jordaneunson.com/wp-content/uploads/2010/07/sardinia_wideweb__430x326-300x227.jpg" alt="" title="sardinia_wideweb__430x326" width="300" height="227" class="size-medium wp-image-753" /></a><p class="wp-caption-text">Jealous?</p></div>So this going to be my last post for a while. Probably till the end of summer. I&#8217;m going on a european vacation with my lady. It&#8217;s going to be an epic adventure full of battles, conquests, and amazing sites. If you want to follow our adventure please <a href="http://jaykayvaycay.tumblr.com">check out our new tumblr blog.</a> </p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=752&title=Vacation Time&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=752" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=752</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Geek Summer Sale</title>
		<link>http://jordaneunson.com/?p=735</link>
		<comments>http://jordaneunson.com/?p=735#comments</comments>
		<pubDate>Fri, 16 Jul 2010 02:32:59 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=735</guid>
		<description><![CDATA[A little bird told me Free Geek Vancouver is having a crazy sale this saturday! Check it out!







]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=735" type="box_count"></fb:share-button><p>A little bird told me <a href="http://www.freegeekvancouver.org">Free Geek Vancouver</a> is having a crazy sale this saturday! Check it out!</p>
<p><a href="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0435.jpg"><img src="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0435-225x300.jpg" alt="" title="IMG_0435" width="225" height="300" class="alignleft size-medium wp-image-736" /></a><a href="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0417.jpg"><img src="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0417-225x300.jpg" alt="" title="IMG_0417" width="225" height="300" class="aligncenter size-medium wp-image-739" /></a><br />
<br />
<a href="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_04211.jpg"><img src="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_04211-300x225.jpg" alt="" title="IMG_0421" width="300" height="225" class="alignleft size-medium wp-image-741" /></a><a href="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0440.jpg"><img src="http://jordaneunson.com/wp-content/uploads/2010/07/IMG_0440-225x300.jpg" alt="" title="IMG_0440" width="225" height="300" class="alignright size-medium wp-image-742" /></a></p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=735&title=Free Geek Summer Sale&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=735" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=735</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m in 24 Hours Vancouver!!</title>
		<link>http://jordaneunson.com/?p=730</link>
		<comments>http://jordaneunson.com/?p=730#comments</comments>
		<pubDate>Tue, 22 Jun 2010 20:17:46 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Free Geek]]></category>
		<category><![CDATA[Vancouver]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=730</guid>
		<description><![CDATA[Somehow I managed to squeeze myself and Free Geek Vancouver into today&#8217;s edition of Vancouver 24 Hours. Hoorah!

http://vancouver.24hrs.ca/News/local/2010/06/21/14469491.html




]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=730" type="box_count"></fb:share-button><p>Somehow I managed to squeeze myself and Free Geek Vancouver into today&#8217;s edition of Vancouver 24 Hours. Hoorah!<br />
<img src="http://vancouver.24hrs.ca/News/local/2010/06/21/24v_freegeek2.jpg" alt="" /><br />
<a href="http://vancouver.24hrs.ca/News/local/2010/06/21/14469491.html">http://vancouver.24hrs.ca/News/local/2010/06/21/14469491.html</a></p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=730&title=I&#8217;m in 24 Hours Vancouver!!&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=730" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=730</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old Trick: Cloning Over Network</title>
		<link>http://jordaneunson.com/?p=727</link>
		<comments>http://jordaneunson.com/?p=727#comments</comments>
		<pubDate>Thu, 17 Jun 2010 23:26:13 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=727</guid>
		<description><![CDATA[Here&#8217;s an old but great trick. I had a server that was dying on me, I wanted to clone the computer but didn&#8217;t want to have the hassle of taking it apart. By using netcat and the dd command I was able to clone the computer over the network. 
First on the destination computer, but [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=727" type="box_count"></fb:share-button><p>Here&#8217;s an old but great trick. I had a server that was dying on me, I wanted to clone the computer but didn&#8217;t want to have the hassle of taking it apart. By using netcat and the dd command I was able to clone the computer over the network. </p>
<p>First on the destination computer, but up off of Ubuntu 10.04 Desktop liveCD and execute the command: </p>
<p><code><br />
nc -l 10000 | dd of=/dev/sda<br />
</code></p>
<p>Then on the source<br />
<code><br />
dd if=/dev/sda | nc <destination IP> 10000<br />
</code></p>
<p>Wait for the dd command to finish. Then reboot the new hardware, if you&#8217;re lucky it should just boot and you&#8217;re done! Yay! If not boot the destination up off of the liveCD once more and mount the drive. Edit any changes in drives (sda/sdb/hda) in /etc/fstab as well as grub. As well as any other changes you have to do, perhaps your modprobe.conf file needs editing. Once done make a new initrd and you&#8217;re happy!</p>
<p><code><br />
/sbin/mkinitrd -v -f /boot/initrd-new.img 2.6.21<br />
</code></p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=727&title=Old Trick: Cloning Over Network&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=727" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=727</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Geek: A Non-Profit Computer Reuse and Recycling Centre.</title>
		<link>http://jordaneunson.com/?p=715</link>
		<comments>http://jordaneunson.com/?p=715#comments</comments>
		<pubDate>Tue, 15 Jun 2010 22:22:02 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=715</guid>
		<description><![CDATA[Free Geek Vancouver (FGV) is a non-profit computer reuse and recycling centre. They accept all computers, old and new as well as related electronics whether they are working or not! FGV is comprised of volunteers who breathe new life into these electronics to create functioning and useable computers. These born again computers are then either [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=715" type="box_count"></fb:share-button><p><a href="http://jordaneunson.com/wp-content/uploads/2010/06/freegeek_logo.png"><img src="http://jordaneunson.com/wp-content/uploads/2010/06/freegeek_logo.png" alt="" title="freegeek_logo" width="127" height="121" class="alignleft size-full wp-image-717" /></a><a href="http://www.freegeekvancouver.org/">Free Geek Vancouver</a> (FGV) is a non-profit computer reuse and recycling centre. They accept all computers, old and new as well as related electronics whether they are working or not! FGV is comprised of volunteers who breathe new life into these electronics to create functioning and useable computers. These born again computers are then either sold at low costs or are granted to various non-profit organizations in need. The computers that cannot be salvaged are disassembled properly and sent to various ethical recycling plants. Free Geek follows a strict recycling code of conduct set in place by the <a href="http://www.ban.org/">Basel Action Network</a>. This ensures that our electronic waste is safely and locally disposed rather than shipped to developing nations where it often contaminates air and water. </p>
<p>You can help Free Geek by bringing your used computer down to be recycled! They&#8217;re located at <a href="http://maps.google.com/maps?f=q&#038;source=s_q&#038;hl=en&#038;geocode=&#038;q=1820+Pandora+St,+Vancouver,+Canada&#038;sll=37.0625,-95.677068&#038;sspn=37.410045,70.136719&#038;ie=UTF8&#038;hq=&#038;hnear=1820+Pandora+St,+Vancouver,+Greater+Vancouver+Regional+District,+British+Columbia,+Canada&#038;z=16">1820 Pandora St in Vancouver.</a> Or if you are interested in lending a hand the please come down this Saturday at either 2 or 4pm for one of our infamous tours!</p>
<p>In today&#8217;s world we are becoming attached to our technology. For many computers are the first things we see in the morning, and the last thing we see before we sleep. They take our daily abuse now if only when we could give them the proper ending they deserve!  </p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=715&title=Free Geek: A Non-Profit Computer Reuse and Recycling Centre.&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=715" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=715</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal.app or Linux Command Shell 101</title>
		<link>http://jordaneunson.com/?p=697</link>
		<comments>http://jordaneunson.com/?p=697#comments</comments>
		<pubDate>Tue, 01 Jun 2010 03:00:15 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Insight]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=697</guid>
		<description><![CDATA[Someone the other day asked me about how I got into the computer industry, and I guess it was because of my father. I still remember the day he brought home our first Commodore 64. The excitement I felt as the disk drive began to makes noises that are reminiscent to some sort of steam [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=697" type="box_count"></fb:share-button><div id="attachment_700" class="wp-caption alignleft" style="width: 310px"><a href="http://jordaneunson.com/wp-content/uploads/2010/05/PA130101.jpg"><img class="size-medium wp-image-700" title="The Folks" src="http://jordaneunson.com/wp-content/uploads/2010/05/PA130101-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">The Folks</p></div>
<p>Someone the other day asked me about how I got into the computer industry, and I guess it was because of my father. I still remember the day he brought home our first Commodore 64. The excitement I felt as the disk drive began to makes noises that are reminiscent to some sort of steam punk robot still resonates within me today. I was roughly eight but from that day on I was hooked, especially when I figured how to use a modem. If my parents read my blog they&#8217;re about to read a story regarding a strange incident from the past.</p>
<p>We had a 300 Baud modem that my father thought didn&#8217;t work and tossed aside, it came with a program called <a href="http://en.wikipedia.org/wiki/Quantum_Link">Quantum Link </a>which eventually turned into AOL. I figured out how this modem worked by reading our subscription to the Computing Monthly Magazine and eventually got connected to a BBS in Toronto. Toronto, the city.</p>
<p>Now if you&#8217;ve been around long enough you&#8217;ll remember that most BBS were crowded services that were hard to get onto as they were all modem based, and if run out of house only had one line dedicated to it. In addition, since modem operate on phone lines you had to physically call the other end, so if the BBS was in Toronto you were basically making a long distance phone call.</p>
<p>My parents could NOT figure out what this number was that racked up so much long distance, and why it would just squeal when they called it. They called the phone company and I think got the charges reversed but I didn&#8217;t want this to happen again. I told some friends of mine who also had a Commodore 64 and they showed me that if you use a touch tone telephone to navigate through an automated phone system at BC Gas you could get to an open relay and make free long distance calls.</p>
<p>Through the years I&#8217;ve learned more and more and eventually got to the point where it&#8217;s now my profession. With this comes the need to have servers and there&#8217;s just something gratifying in having that &#8220;server under the bed.&#8221; My parents just so happen to have a spare bedroom in their house and thus the perfect place for my server to live. However every so often it needs some maintenance and thus my Dad is the one who intervenes. Recently though the requests I&#8217;ve been making of him have been getting more and more complicated and so I wrote a Linux Command Shell 101, to which I now share with you world. For all you people learning the shell for the first time.</p>
<p>Hi Dad,</p>
<p>So I&#8217;ve decided that it&#8217;s time you learn the command shell in Linux and how to use it. Yes, you have to read this <img src='http://jordaneunson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Chapter 1 &#8211; The Shell</h3>
<p>The shell is actually not that complicated, but if you don&#8217;t understand what you&#8217;re looking at it can be very confusing. First what is a command shell? Well it&#8217;s actually no different than a programming language. It&#8217;s a way of giving the computer commands and interacting with it in either one off commands or in a script. There are many types of shells as well, the most common is the Bourne Again SHell or BASH for short, for the most part this is the defacto standard shell. Some other shells are:</p>
<p>ash<br />
kash<br />
tsh<br />
tcsh</p>
<p>Most  shells are all the same thing, the only difference between them is small grammatical differences. For example, and don&#8217;t worry that you have no idea what this is about.</p>
<p>bash ${variable}<br />
ash $variable<br />
kash $|variable|</p>
<p>see? small differences. So in summary the shell is a place where you can input commands to the computer and the computer executes them for you.</p>
<p>Next is a look at the shell. The following is what my shell looks like on my mac.</p>
<p><code>bart:~ jordan$ </code></p>
<p>This is a command prompt. When you see something like this it means that computer is ready to accept commands.</p>
<p>So there are a few pieces of information here.<br />
The first word tells us the name of the computer. In this case, my computer&#8217;s name is bart. Another word for the computers name is hostname<br />
&#8220;:&#8221; indicates the end of the hostname,<br />
&#8220;~&#8221; tells us the path  that we are currently located (more about path later)<br />
then username that we&#8217;re currently logged in as.<br />
The $ tells us its the end of the prompt.</p>
<p>Now some prompts may look a little different from this but they&#8217;ll be the same more or less. Here&#8217;s what it looks like when I&#8217;m logged in as root</p>
<p><code>bart:~ root# </code></p>
<p>notice the only difference is the end of the prompt has a pound symbol instead of a dollar sign. This is because we&#8217;re root. All users prompts end in a dollar sign but only the root user ends in a pound. So if you ever encounter a prompt with nothing but just a dollar sign OR a pound you&#8217;ll still know that its a prompt.</p>
<h3>Chapter 2 &#8211; Command Structure</h3>
<p>Now it&#8217;s time to give the computer a command. You already know what a command is, its basically a program that runs in text mode. Commands can be anything from something simple like &#8220;cd&#8221; (change directory) to something complicated like &#8220;firefox-text&#8221; (text mode on firefox) When you give a shell a command there are a few things that you need to be aware of. First is a switch.</p>
<p>Switchs<br />
A switch is a modifier that you give to the command to change what the command does. For example the command &#8220;ls&#8221; gives a listing of the files in the current directory. So here&#8217;s an example of the ls command listing the files in my home directory.</p>
<p><code><br />
bart:~ jordan$ ls<br />
Applications	Downloads	Movies		Public		bin<br />
Desktop		Library		Music		Sites		test<br />
Documents	LimeWire	Pictures	bash.test	zimbra<br />
bart:~ jordan$<br />
</code></p>
<p>Now what I&#8217;m going to do is give the same command but with the -l switch. (that&#8217;s a lower case L)</p>
<p><code><br />
bart:~ jordan$ ls -l<br />
total 16<br />
drwxr-xr-x   3 jordan  staff   102 12 May 23:40 Applications<br />
drwx------  20 jordan  staff   680 22 May 02:41 Desktop<br />
drwxr--r--@ 39 jordan  staff  1326 12 May 23:31 Documents<br />
drwx------  40 jordan  staff  1360 18 May 09:22 Downloads<br />
drwx------  47 jordan  staff  1598 23 May 20:01 Library<br />
drwxr-xr-x   4 jordan  staff   136 12 Feb 10:09 LimeWire<br />
drwx------  12 jordan  staff   408 16 May 23:17 Movies<br />
drwxr--r--  21 jordan  staff   714 24 Mar 19:41 Music<br />
drwxr--r--  23 jordan  staff   782  7 May 23:33 Pictures<br />
drwxr-xr-x   5 jordan  staff   170 16 Sep  2009 Public<br />
drwxr-xr-x@  7 jordan  staff   238  2 Nov  2009 Sites<br />
-rwxr-xr-x   1 jordan  staff    73 23 May 15:03 bash.test<br />
drwxr-xr-x   6 jordan  staff   204  7 May 23:33 bin<br />
-rw-r--r--   1 jordan  staff    19 18 May 12:07 test<br />
drwxr-xr-x   3 jordan  staff   102  9 May 17:40 zimbra<br />
bart:~ jordan$<br />
</code></p>
<p>see how command changes? It&#8217;s the same command, it does the same thing in that it lists all the files and folders but it also gives me LOTS of other options such as owner, size, date, etc.</p>
<p>Arguments<br />
Next is an argument, an argument usually goes with a switch. So say you have a command like a text editor. One example of a text editor is &#8220;nano&#8221; if you just type edit the computer will not do anything, you have to give it a file to edit as well. So for example:</p>
<p><code><br />
nano example.txt<br />
</code></p>
<p>We see here that &#8220;nano&#8221; (which is used as an example only) is the command and &#8220;example.txt&#8221; is the argument. </p>
<h3>Final Chapter &#8211; Commands</h3>
<p>Finally I&#8217;m just going to touch a few basic and extremely common commands as well as a way of searching for commands and their manuals. First let&#8217;s introduce you to a utility called &#8220;apropos&#8221; To use apropos you simply type it in followed by an argument in quotations. ie: apropos &#8220;move files&#8221;  What this will do is search all the commands available on your computer for something that matches &#8220;move files&#8221; Think of it as a search engine for commands, a really dumb search engine. It&#8217;s dumb because if you don&#8217;t pick the right words to search for it won&#8217;t find anything. Take this for example. apropos &#8220;make folder&#8221; will find nothing but apropos &#8220;create folder&#8221; will have many search results.</p>
<p>So let&#8217;s use apropos to find a command to move files</p>
<p><code><br />
bart:~ jordan$ apropos "move files"<br />
mv(1)                    - move files<br />
removefile(3), removefile_state_alloc(3), removefile_state_free(3), removefile_state_get(3), removefile_state_set(3) - remove files or directories<br />
srm(1)                   - securely remove files or directories<br />
bart:~ jordan$<br />
</code></p>
<p>So in the search results here there are the actual commands on the left (ignore the number in the brackets) and then explanations on the right. The first line looks like the one the that we want, the second (and third) line looks like garbage and the last line is some command to remove files. Apropos found the last line because we searched for move files and reMOVE FILES matches that. See how it&#8217;s dumb?</p>
<p>Ok so the command we want is the first line, mv. Next we need to learn how to use this command, what switches and arguments it can take so what we do is use another command called &#8220;man&#8221; man is short for manual. Simple. We type man and then the command name as an argument. for example</p>
<p><code><br />
bart:~ jordan$ man mv<br />
MV(1)                     BSD General Commands Manual                    MV(1)</code></p>
<p><code>NAME<br />
mv -- move files</p>
<p>SYNOPSIS<br />
mv [-f | -i | -n] [-v] source target<br />
mv [-f | -i | -n] [-v] source ... directory</p>
<p>DESCRIPTION<br />
In its first form, the mv utility renames the file named by the source<br />
operand to the destination path named by the target operand.  This form<br />
is assumed when the last operand does not name an already existing direc-<br />
tory.</p>
<p></code></p>
<p><code> In its second form, mv moves each file named by a source op...... ETC ETC ETC<br />
</code></p>
<p>To navigate this man page you can use the up and down arrows as well as the page up and page down keys. To exit push &#8220;q&#8221;</p>
<p>There you have it between apropos and man you can search and learn all commands linux. Here are a few commands that very important for you to know.</p>
<p>ls: list files and folders in current directory<br />
cd: change directory<br />
mkdir: make directory<br />
rm:  remove file<br />
rm -rf: remove files and folders, WITHOUT VERFICATION<br />
mv: move files and folders<br />
pwd: display current directory<br />
whoami: display your username<br />
nano: an easy to use text editor, to use it just type &#8220;nano &#8221;<br />
exit: exits the shell</p>
<p>Ok, so this is pretty short and brief but hopefully was a good introduction to the Linux command shell. If you have questions or if something I wrote doesn&#8217;t make sense email me back and let me know.</p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=697&title=Terminal.app or Linux Command Shell 101&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=697" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=697</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard Server and Linux client using LDAP and libpam-krb5</title>
		<link>http://jordaneunson.com/?p=689</link>
		<comments>http://jordaneunson.com/?p=689#comments</comments>
		<pubDate>Mon, 24 May 2010 23:33:05 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[krb5]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=689</guid>
		<description><![CDATA[This is an extension article to my previous article Open Directory, Kerberos, Single Sign On (SSO) and CentOS with SSH and Kerberized NFS Home Directories. I had some requests from different Linux users out there how to incorporate authentication for Linux flavours other than CentOS. For this example we&#8217;re going to use Debian Lenny with [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=689" type="box_count"></fb:share-button><p>This is an extension article to my previous article <a href="http://jordaneunson.com/?p=523">Open Directory, Kerberos, Single Sign On (SSO) and CentOS with SSH and Kerberized NFS Home Directories.</a> I had some requests from different Linux users out there how to incorporate authentication for Linux flavours other than CentOS. For this example we&#8217;re going to use Debian Lenny with some Ubuntu 10.04 refs thrown in. </p>
<h3>Preperation &#8211; LDAP</h3>
<p>First download all the packages that we&#8217;ll need.<br />
<b>Debian</b><br />
<code>apt-get install nss_updatedb ldap-utils libpam-ldap libnss-ldap nscd</code><br />
<b>Ubuntu</b><br />
<code>apt-get install nss_updatedb ldap-utils libpam-ldap libnss-ldap nscd nslcd</code><br />
During the installation debconf should ask you some questions, here are my answers<br />
<code><br />
LDAP server Uniform Resource Identifier: ldap://<hostip-here>/ (Note the "ldap://", NOT "ldapi://"!)<br />
Distinguished name of the search base: dc=foo,dc=bar<br />
LDAP version to use: 3<br />
Does the LDAP database require login? No<br />
Special LDAP privileges for root? No<br />
Make the configuration file readable/writeable by its owner only? No<br />
Make local root Database admin. No<br />
Does the LDAP database require login? No<br />
Local crypt to use when changing passwords. crypt<br />
</code></p>
<p>If you&#8217;re not on Debian you can edit these options in the file <code>/etc/ldap/ldap.conf</code> and <code>/etc/libnss-ldap.conf</code></p>
<p>Next, edit <code>/etc/nsswitch.conf</code> and change<br />
<code><br />
passwd: compat<br />
groups: compat</p>
<p>--to--</p>
<p>passwd: files ldap<br />
groups: files ldap<br />
</code></p>
<p>Now restart the nscd service ( and nslcd if you&#8217;re using Ubuntu 10.04 ) </p>
<p>Verify you can see the users via LDAP with the id or getent commands<br />
<code><br />
jordan@elm:/$ id jordan<br />
uid=1000(jordan) gid=100(users) groups=1001(ldap-admin),1022(fgstaff),1023(ssh-access),100(users)<br />
</code><br />
<code><br />
jordan@elm:/$ getent passwd | grep jordan<br />
jordan:x:1000:100:Jordan Eunson:/net/home/jordan:/bin/bash<br />
jordan@elm:/$<br />
</code></p>
<h3>Preperation &#8211; libpam-krb5</h3>
<p>Download and install the packages<br />
<code>apt-get install krb5-config libpam-krb5</code></p>
<p>Then edit your <em>/etc/krb5.conf</em> file. Now here what you *could* do is copy the one from you Mac. If you have a Mac client already bound to your Open Directory installation then open the file <em>/Library/Preferences/edu.mit.Kerberos</em> and copy and paste the content to <em>/etc/krb5.conf</em></p>
<p>Here is an example of mine for the realm FOO.BAR<br />
<code><br />
[libdefaults]<br />
       default_realm = FOO.BAR<br />
[realms]<br />
        FOO.BAR = {<br />
               admin_server = od-master.foo.bar<br />
               kdc = od-master.foo.bar<br />
       }<br />
[domain_realm]<br />
       .foo.bar =  FOO.BAR<br />
      foo.bar = FOO.BAR<br />
[logging]<br />
       admin_server = FILE:/var/log/krb5kdc/kadmin.log<br />
       kdc = FILE:/var/log/krb5kdc/kdc.log<br />
</code></p>
<p>To test to see if this is working type the command <em>kinit</em> and see if we can get a ticket from the Kerberos Key Distribution Center</p>
<p><code><br />
bart:~ jordan$ kinit jeunson<br />
Please enter the password for jeunson@FOO.BAR:<br />
bart:~ jordan$ klist<br />
Kerberos 5 ticket cache: 'API:Initial default ccache'<br />
Default principal: jeunson@FOO.BAR</p>
<p>Valid Starting     Expires            Service Principal<br />
05/24/10 16:30:35  05/25/10 02:29:14  krbtgt/FOO.BAR@FOO.BAR<br />
	renew until 05/31/10 16:30:35</p>
<p>bart:~ jordan$<br />
</code></p>
<h3>Kerberos Authentication</h3>
<p>Now that we have our Kerberos client working we can integrate the local system to LDAP for user lookup and Kerberos for passwords with PAM libraries. </p>
<p>/etc/pam.d/common-account<br />
<code><br />
account sufficient      pam_unix.so<br />
account required        pam_krb5.so<br />
</code></p>
<p>/etc/pam.d/common-auth<br />
<code><br />
auth    sufficient        pam_unix.so nullok_secure<br />
auth    sufficient        pam_krb5.so use_first_pass<br />
auth    required          pam_deny.so<br />
</code></p>
<p>/etc/pam.d/common-session<br />
<code><br />
session required        pam_unix.so<br />
#session required        pam_mkhomedir.so skel=/etc/skel/ umask=0022<br />
session  optional  pam_krb5.so minimum_uid=1000<br />
</code></p>
<p>Now try to login to your Linux client either on the console to see if it works. To finish up with Kerberizing the client please read <a href="http://jordaneunson.com/?p=523">this article</a></p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=689&title=Snow Leopard Server and Linux client using LDAP and libpam-krb5&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=689" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=689</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>X forwarding on SSH after `sudo -u  -i` or `sudo su`</title>
		<link>http://jordaneunson.com/?p=686</link>
		<comments>http://jordaneunson.com/?p=686#comments</comments>
		<pubDate>Mon, 24 May 2010 22:31:02 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=686</guid>
		<description><![CDATA[X authentication over SSH is based on magic cookies! The problem though is that when you change users via sudo the new user is not aware of these magic cookies. 
Before you issue the su (but after having ssh&#8217;ed into the remote
system), request the cookie for the current DISPLAY that&#8217;s connecting
to your X server:

bart:~ jordan$ [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=686" type="box_count"></fb:share-button><p>X authentication over SSH is based on magic cookies! The problem though is that when you change users via sudo the new user is not aware of these magic cookies. </p>
<p>Before you issue the su (but after having ssh&#8217;ed into the remote<br />
system), request the cookie for the current DISPLAY that&#8217;s connecting<br />
to your X server:</p>
<p><code><br />
bart:~ jordan$ xauth list $DISPLAY</p>
<p>hostname.hq.calltitan.com:10  MIT-MAGIC-COOKIE-1<br />
4d22408a71a55b41ccd1657d377923ae<br />
</code><br />
Then, after having done su, tell the new user what the cookie is:</p>
<p><code>bart:~ root# xauth add hostname.hq.calltitan.com:10  MIT-MAGIC-COOKIE-1<br />
4d22408a71a55b41ccd1657d377923ae</code></p>
<p>Just cut&#8217;n-paste the output of the above &#8216;xauth list&#8217; onto &#8216;xauth add&#8217;<br />
That&#8217;s it. </p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=686&title=X forwarding on SSH after `sudo -u <user> -i` or `sudo su`&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=686" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=686</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Directory, Kerberos, Single Sign On (SSO) and CentOS with SSH and Kerberized NFS Home Directories</title>
		<link>http://jordaneunson.com/?p=523</link>
		<comments>http://jordaneunson.com/?p=523#comments</comments>
		<pubDate>Mon, 17 May 2010 07:09:00 +0000</pubDate>
		<dc:creator>jordan</dc:creator>
				<category><![CDATA[Kerberos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS X Server]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[krb5]]></category>

		<guid isPermaLink="false">http://jordaneunson.com/?p=523</guid>
		<description><![CDATA[This article is a pseudo continuation of the article: Using Network Accounts on a Linux Client with Open Directory Leopard Server. In this article I&#8217;m going to be going over at a high level the single sign-on environment in Mac OS X Server and at a low level on integrating Kerberized SSH and NFS and [...]]]></description>
			<content:encoded><![CDATA[<fb:share-button href="http://jordaneunson.com/?p=523" type="box_count"></fb:share-button><p>This article is a pseudo continuation of the article: <a href="http://jordaneunson.com/?p=300">Using Network Accounts on a Linux Client with Open Directory Leopard Server.</a> In this article I&#8217;m going to be going over at a high level the single sign-on environment in Mac OS X Server and at a low level on integrating Kerberized SSH and NFS and CentOS.</p>
<p>Please note the benefits of Kerberized NFS is that if a local computer is compromised the attacker will not be able to read NFS shares because they will not have a valid Kerberos ticket. Oh&#8230; and the whole NFS stream will be encrypted. (pow!)</p>
<h2>Open Directory and Kerberos</h2>
<p><a href="http://jordaneunson.com/wp-content/uploads/2010/05/dog-and-keys-600x380.jpg"><img class="alignright size-medium wp-image-627" title="Kerberos" src="http://jordaneunson.com/wp-content/uploads/2010/05/dog-and-keys-600x380-300x190.jpg" alt="" width="300" height="190" /></a>Taken from <a href="http://developer.apple.com/opensource/kerberosintro.html">Apple&#8217;s</a> site: Picture walking into the local county fair, and you are given two choices. You can either use your credit card at the entry of every ride or you can use it once at a booth, which grants you a ticket that you can use for the remainder of the day. It&#8217;s a pretty simple choice if you&#8217;re concerned about the security of your credit card information and want to have a hassle-free day at the park.</p>
<p>This is exactly what Kerberos accomplishes in its implementation of Single Sign On in network environments. At the beginning of the workday, a user enters his/her password into the system once; this action decrypts a ticket from a server running as a Kerberos Key Distribution Center (KDC). The ticket holds a set of encrypted keys, which are used throughout the day to authenticate user access without exchanging sensitive password information. It expires after a given amount of time (typically one day), so even if a would-be intruder sniffs it out and decrypts the information, the user-access information remains safe in the long term.</p>
<p>With your Kerberos ticket you can be granted password-less access to services across a multitude of platforms. You could be on your Mac client with a valid Kerberos ticket and authenticate to a Linux VNC server, or a Mac AFP/NFS server, or a simple SSH session. The possibilities are <a href="http://www.zombo.com">mind blowing!</a></p>
<p>As a side note: in this article the OD master will be referred to as foo and the linux client named lame with the domain of example.bar</p>
<h3>Open Directory and Kerberos Setup</h3>
<p>This article assumes your are somewhat of a valid Systems Admin and were able of getting your OD environment up and running without issue. If not please read: <a href="http://www.makemacwork.com/master-open-directory-1.htm">http://www.makemacwork.com/master-open-directory-1.htm</a></p>
<p>At a real high level here are the steps:</p>
<ol>
<li>set the hostname of your OD master</li>
<li>in Server Admin turn DNS on and setup</li>
<li>use `dig` to verify your forward and reverse DNS records to your OD master</li>
<li>set Open Directory in Server Admin to `Open Directory Master`</li>
<li>start binding clients</li>
</ol>
<p>Extra tip and trick. In Server Admin -&gt; Open Directory, there is an option I believe under Policy-&gt;binding that says something to effect of: Require authenticated binding between Directory and Clients. Enable this, then bind your Mac clients. What it will do when binding is ask for a username and password and computer record, enter your diradmin credentials and the FQDN of the host you are binding. For example, if your domain is example.bar and your client&#8217;s hostname is foo then enter: <code>foo.example.bar</code></p>
<h2>Kerberized SSH</h2>
<p>For the Mac use /Applications/Utilities/Directory Utility to bind your Mac to the OD master. </p>
<p>On the Linux / CentOS side we&#8217;re going to setup Kerberos. First install kerberos with yum<br />
<code>sudo yum install krb5-auth-dialog krb5-devel krb5-libs pam_krb5-2.2.14-10 krb5-workstation<br />
</code></p>
<p>Now from the Gnome GUI go to System->Administration->Authentication </p>
<ul>
<li>Check, <em>Enable LDAP Support</em></li>
<li>Enter your LDAP search base and server address. Mine for this example would look like:</li>
<p><a href="http://jordaneunson.com/wp-content/uploads/2010/05/Screen-shot-2010-05-16-at-1.51.17-PM.png"><img src="http://jordaneunson.com/wp-content/uploads/2010/05/Screen-shot-2010-05-16-at-1.51.17-PM.png" alt="" title="LDAP look ups" width="435" height="202" class="aligncenter size-full wp-image-654" /></a></p>
<li>If you don&#8217;t know your LDAP search base you can get it from the Overview Pane in Server Admin / Open Directory</li>
<li>Click OK on this dialog box and then select the <em>Authentication</em> tab</li>
<li>Check <i>Enable Kerberos Support</i> and click <i>Configure Kerberos</i></li>
<li>The realm should be the same as your LDAP search base in a different format, mine looks like this:</li>
<p><a href="http://jordaneunson.com/wp-content/uploads/2010/05/Screen-shot-2010-05-16-at-1.57.27-PM.png"><img src="http://jordaneunson.com/wp-content/uploads/2010/05/Screen-shot-2010-05-16-at-1.57.27-PM.png" alt="" title="Kerberos Setup" width="300" height="266" class="alignleft size-full wp-image-656" /></a></p>
<p>After binding your Mac and Linux clients let&#8217;s check to make sure it works. On either client type on the terminal <i>kinit</i> type in your password and then check to make sure you got your Kerberos ticket with <i>klist</i>. You should get the following response.<br />
<code><br />
bart:~ jordan$ kinit jeunson<br />
Please enter the password for jeunson@EXAMPLE.BAR: <type in your password><br />
bart:~ jordan$<br />
bart:~ jordan$<br />
bart:~ jordan$<br />
bart:~ jordan$ klist<br />
Kerberos 5 ticket cache: 'API:Initial default ccache'<br />
Default principal: jeunson@EXAMPLE.BAR</p>
<p>Valid Starting     Expires            Service Principal<br />
05/16/10 13:30:30  05/16/10 23:29:36  krbtgt/EXAMPLE.BAR@EXAMPLE.BAR<br />
	renew until 05/23/10 13:30:30<br />
</code></p>
<p>The command kinit is what is used to authenticate ourselves to the Kerberos Key Distribution Center (KDC) and grant us access to all Kerberized services. It is essential to have this ticket before proceeding. </p>
<p>Now that we know that Kerberos is working correctly we&#8217;re now going to setup Kerberized SSH. For your Mac and Linux clients we&#8217;re going to edit <i>/etc/ssh_config</i> or <i>/etc/ssh/ssh_config</i> depending on your Linux distro, you will want the following options set.<br />
<code><br />
   GSSAPIAuthentication yes<br />
   GSSAPIDelegateCredentials yes<br />
   GSSAPIKeyExchange yes<br />
   GSSAPITrustDNS yes<br />
</code></p>
<p>For the SSH server on the Mac side set the following options: <i>/etc/sshd_config</i><br />
<code><br />
GSSAPIAuthentication yes<br />
GSSAPICleanupCredentials yes<br />
GSSAPIStrictAcceptorCheck no<br />
GSSAPIKeyExchange yes</p>
<p>KerberosAuthentication yes<br />
KerberosOrLocalPasswd no<br />
KerberosTicketCleanup yes<br />
</code></p>
<p>For the SSH servers on the Linux side set the following options: <i>/etc/ssh/sshd_config</i><br />
<code><br />
GSSAPIAuthentication yes<br />
GSSAPICleanupCredentials no</p>
<p>KerberosAuthentication no<br />
KerberosOrLocalPasswd no<br />
KerberosTicketCleanup yes<br />
</code></p>
<p>Restart all SSHd services and make sure you have a fresh ticket from Kerberos. </p>
<h3>Testing</h3>
<p>First make sure you have a fresh new ticket using kinit and klist. Then try to ssh from your mac client to the Linux server or Mac server. It <i>should</i> let you in automagically. If not run ssh in ultra verbose mode to try and debug the problem. It&#8217;s usually comes down to some sort of DNS problem so make sure the Linux server you&#8217;re connecting to has DNS records for it and they resolve properly both forwards and reverse. </p>
<h2>Kerberized NFS</h2>
<p>First, you need to setup an NFS server on your Mac server. I&#8217;m not explaining how to do that. But I will say that you NFS mounts should be set to &#8220;Any&#8221; authentication setting for testing purposes. To learn more read the Apple server manual. <img src='http://jordaneunson.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><code><b>DANGER!</b></code><br />
First ensure that the client machine has a DNS record and is resolvable both forwards and reverse and ensure that the /etc/hosts file isn&#8217;t treading on the DNS records. Also before we proceed I must make it clear that you are very careful with this section. You will be connecting to the Kerberos Key Distribution Centre that is served inside of your Open Directory server. If you accidentally break something there is a risk that you will break your installation of OD and you will have to rebuild the whole Directory.</p>
<p>SSH in the linux host and check out a kerberos for the directory administrator.<br />
<code><br />
[root@lame]# kdestroy<br />
[root@lame]# kinit diradmin<br />
Password for diradmin@EXAMPLE.BAR:<br />
[root@lame]# klist<br />
Ticket cache: FILE:/tmp/krb5cc_3001_7WM4As<br />
Default principal: diradmin@EXAMPLE.BAR</p>
<p>Valid starting     Expires            Service principal<br />
05/16/10 23:28:42  05/17/10 09:28:42  krbtgt/EXAMPLE.BAR@EXAMPLE.BAR<br />
	renew until 05/17/10 23:27:45</p>
<p>[root@lame]#<br />
</code></p>
<p>With this ticket you can now login to the KDC server. The following command references the file <i>/etc/krb5.conf</i> to locate the KDC server, it is then passed the -p switch with the name of principle to use when connecting. </p>
<p><code>/usr/kerberos/sbin/kadmin -p diradmin@EXAMPLE.BAR</code></p>
<p>From here on in, you must be very very careful. This is the Kerberos Key Distribution Centre. We&#8217;re going to be adding three principles to the KDC; host, root and nfs. The last one, nfs, requires a <a href="http://support.apple.com/kb/TA25186?viewlocale=en_US">special option</a> to make it works. Please make sure to type the FQDN of the linux client.<br />
<code><br />
addprinc -randkey host/lame.example.bar@EXAMPLE.BAR<br />
addprinc -randkey root/lame.example.bar@EXAMPLE.BAR<br />
addprinc -randkey -e des-cbc-crc:normal nfs/lame.example.bar@EXAMPLE.BAR<br />
<font color="black">Now lets copy those principals out of the KDC to the local file system</font><br />
ktadd -k /etc/krb5.keytab host/lame.example.bar@EXAMPLE.BAR<br />
ktadd -k /etc/krb5.keytab root/lame.example.bar@EXAMPLE.BAR<br />
ktadd -k /etc/krb5.keytab -e des-cbc-crc:normal nfs/lame.example.bar@EXAMPLE.BAR<br />
quit<br />
</code></p>
<p>Make sure this worked by reading the /etc/krb5.keytab file:</p>
<p><code><br />
[root@lame]# sudo klist -k /etc/krb5.keytab<br />
Password:<br />
Keytab name: FILE:/etc/krb5.keytab<br />
KVNO Principal<br />
---- --------------------------------------------------------------------------<br />
   4 host/lame.example.com@EXAMPLE.BAR<br />
   4 host/lame.example.com@EXAMPLE.BAR<br />
   4 host/lame.example.com@EXAMPLE.BAR<br />
   4 root/lame.example.com@EXAMPLE.BAR<br />
   4 root/lame.example.com@EXAMPLE.BAR<br />
   4 root/lame.example.com@EXAMPLE.BAR<br />
   4 nfs/lame.example.com@EXAMPLE.BAR<br />
[root@lame]#<br />
</code></p>
<p>Now there are two daemons that need to be running to make kerberized nfs work. They are rpcgssd and rpcsvcgssd. To get this up we must edit the /etc/sysconfig/nfs file and uncomment the following lines:<br />
<code><br />
MOUNTD_NFS_V3="yes"<br />
SECURE_NFS="yes"<br />
</code><br />
Then start up /etc/init.d/{rpcgssd,rpcsvcgssd} restart<br />
Make sure to add them to the default run level<br />
<code><br />
[root@lame]# /sbin/chkconfig rpcgssd on<br />
[root@lame]# /sbin/chkconfig rpcsvcgssd on<br />
</code></p>
<h3>Testing</h3>
<p>Let&#8217;s try mounting a Kerberized NFS mount. First let&#8217;s make the folder <i>/mnt/nfs</i> Now issue a mount command. </p>
<p><code><br />
sudo mount -t nfs -o sec=krb5p foo.example.bar:/Volumes/Data/Users /mnt/nfs<br />
<font color="black">This "should" mount the NFS share on /mnt/nfs. Use the mount command again to see the krb5p option in action!</font><br />
<i>Some lines omitted</i><br />
foo.example.bar:/Volumes/Data/Users on /Volumes/Data/Users type nfs (rw,nosuid,nodev,hard,intr,sec=<b>krb5p</b>,addr=10.10.10.10)<br />
</code></p>
<p>Tada! It Works! <img src='http://jordaneunson.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div id="buzz_share_1" style="float: right; margin-right: 10px">
<a rel="nofollow external" target="_blank" href="http://www.google.com/reader/link?url=http://jordaneunson.com/?p=523&title=Open Directory, Kerberos, Single Sign On (SSO) and CentOS with SSH and Kerberized NFS Home Directories&srcURL=http://worpdressapi.com/">
<img width="50" height="58" alt="" src="http://jordaneunson.com/wp-content/plugins/google-buzz-button//images/google-buzz.png" original="http://wordpressapi.com/wp-content/plugins/google-buzz/google-buzz.png" style="display: inline;"/>
</a>
</div><fb:share-button href="http://jordaneunson.com/?p=523" type="box_count"></fb:share-button>]]></content:encoded>
			<wfw:commentRss>http://jordaneunson.com/?feed=rss2&amp;p=523</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
