<?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>Dan Bishop &#187; Software</title>
	<atom:link href="http://www.danbishop.org/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danbishop.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:17:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Build an Ubuntu 11.10 SBS (Small Business Server)</title>
		<link>http://www.danbishop.org/2011/10/29/ubuntu-11-10-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/</link>
		<comments>http://www.danbishop.org/2011/10/29/ubuntu-11-10-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 10:23:02 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[openldap]]></category>
		<category><![CDATA[sbs]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=586</guid>
		<description><![CDATA[This guide will help you configure Ubuntu Server Edition 11.10 for a small/medium business. The server will provide DHCP, DNS, NTP, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network. The first thing to [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/10/29/ubuntu-11-10-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/" size="small" count="true"></div></div><p>This guide will help you configure Ubuntu Server Edition 11.10 for a small/medium business. The server will provide DHCP, DNS, NTP, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network.</p>
<p>The first thing to get your server to do is act as a DHCP and DNS server. This will allow you to map hostnames to IP addresses (and vice versa!) automatically. This means all network clients will know that neo.danbishop.org and 192.168.0.2 are one and the same. This is ESSENTIAL if you plan to use Kerberos later on.<span id="more-586"></span></p>
<p>Make sure you have disabled DHCP on your router and set a static IP address for the server. This is done by editing /etc/network/interfaces like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
&nbsp;
# The loopback network interface
auto lo
iface lo inet loopback
&nbsp;
# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1</pre></div></div>

<p>It&#8217;s time to configure resolv.conf so that your server (and soon clients) can query name servers other than your own. This way, when a client looks up an address outside of danbishop.org (google.co.uk for example) dnsmasq (the software we&#8217;ll be using for DHCP and DNS) will query the name servers in resolv.conf. Dnsmasq will then cache the IP for subsequent requests from any client speeding up DNS across your network <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In this case we&#8217;re going to use our own DNS server as the primary DNS, followed by Google&#8217;s public DNS servers. You can of course substitute Google&#8217;s servers for your own ISP&#8217;s, or any other DNS server.</p>
<p>So time to edit /etc/resolv.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">domain danbishop.org 
search danbishop.org 
nameserver 192.168.0.2
nameserver 8.8.8.8 
nameserver 8.8.4.4</pre></div></div>

<p>Now it&#8217;s time to install Dnsmasq:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> dnsmasq</pre></div></div>

<p>Dnsmasq will take care of both DNS and DHCP for your network. We will configure it so that as it allocates IP addresses to clients on the network, it also adds them into its DNS server. This way both forward and reverse lookups will work on any machine, as required by Kerberos <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The configuration file for Dnsmasq (/etc/dnsmasq.conf) is HUGE. However it is VERY well commented making it very easy to play around. The important things for this guide are:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">domain=danbishop.org				#sets the domain name you're going to use
dhcp-range=192.168.0.50,192.168.0.150,12h	#sets the range from which to allocate IP addresses to clients and the lease time
dhcp-option=option:router,192.168.0.1		#sets the IP address of the router (gateway address) to be given to clients
dhcp-option=option:ntp-server,192.168.0.2 #sets the NTP server to 192.168.0.2
dhcp-authoritative				#makes this the authoritative (in this case ONLY) DHCP server on the network
&nbsp;
# Server DNS settings... this is required as the server itself will
# not be obtaining it's IP address via DHCP and therefore would 
# not be automatically added to the DNS records for forward/reverse
# DNS queries as required by Kerberos
ptr-record=2.0.168.192.in-addr.arpa.,&quot;neo.danbishop.org&quot; 
address=/neo.danbishop.org/192.168.0.2 
&nbsp;
# Kerberos and LDAP automatic stuff...
# This maps kerberos.danbishop.org and
# ldap.danbishop.org to the server and also makes all
# dhcp clients aware of the kerberos realm... magic :D
address=/kerberos.danbishop.org/192.168.0.2 
address=/ldap.danbishop.org/192.168.0.2 
&nbsp;
txt-record=_kerberos.danbishop.org,&quot;DANBISHOP.ORG&quot;
srv-host=_kerberos._udp.danbishop.org,&quot;kerberos.danbishop.org&quot;,88
srv-host=_kerberos._tcp.danbishop.org,&quot;kerberos.danbishop.org&quot;,88
srv-host=_kerberos-master._udp.danbishop.org,&quot;kerberos.danbishop.org&quot;,88
srv-host=_kerberos-adm._tcp.danbishop.org,&quot;kerberos.danbishop.org&quot;,749
srv-host=_kpasswd._udp.danbishop.org,&quot;kerberos.danbishop.org&quot;,464
&nbsp;
srv-host=_ldap._tcp.danbishop.org,ldap.danbishop.org,389</pre></div></div>

<p>It is well worth reading through the entire configuration file though as there is a lot to be learnt from the excellent comments!</p>
<p>Dnsmasq is now configured to act as your network&#8217;s DHCP server and clients are told to use your server for DNS queries. Now you&#8217;re all set to get DNS and DHCP up and running. Simply restart the service to load the new configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service dnsmasq restart</pre></div></div>

<h2>References</h2>
<p><a href="https://help.ubuntu.com/community/Dnsmasq" onclick="pageTracker._trackPageview('/outgoing/help.ubuntu.com/community/Dnsmasq?referer=');">https://help.ubuntu.com/community/Dnsmasq</a></p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=586&amp;md5=68d3eb8279d672e9290bc5686424a3a7" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/10/29/ubuntu-11-10-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=586&amp;md5=68d3eb8279d672e9290bc5686424a3a7" type="text/html" />
	</item>
		<item>
		<title>How to mount SFTP/SSH shares in OS X Lion</title>
		<link>http://www.danbishop.org/2011/09/10/how-to-mount-sftpssh-shares-in-os-x-lion/</link>
		<comments>http://www.danbishop.org/2011/09/10/how-to-mount-sftpssh-shares-in-os-x-lion/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 08:52:47 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=573</guid>
		<description><![CDATA[If you&#8217;d like to use an sftp share directly though finder then this guide is for you. First, you need to install OSXFuse from https://github.com/osxfuse/osxfuse/downloads At the &#8220;Installation Type&#8221; stage, be sure to select MacFUSE Compatibility Layer. It&#8217;s unticked by default. Once installed, you need to get Macfusion from http://macfusionapp.org/ Perform the usual drag and [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/09/10/how-to-mount-sftpssh-shares-in-os-x-lion/" size="small" count="true"></div></div><p>If you&#8217;d like to use an sftp share directly though finder then this guide is for you.</p>
<p>First, you need to install OSXFuse from <a href="https://github.com/osxfuse/osxfuse/downloads" onclick="pageTracker._trackPageview('/outgoing/github.com/osxfuse/osxfuse/downloads?referer=');">https://github.com/osxfuse/osxfuse/downloads</a></p>
<p>At the &#8220;Installation Type&#8221; stage, be sure to select MacFUSE Compatibility Layer. It&#8217;s unticked by default.</p>
<p>Once installed, you need to get Macfusion from <a href="http://macfusionapp.org/" onclick="pageTracker._trackPageview('/outgoing/macfusionapp.org/?referer=');">http://macfusionapp.org/</a></p>
<p>Perform the usual drag and drop into your Applications folder then run Macfusion.</p>
<p>Add a new Macfusion share by clicking on the plus icon and selecting SSHFS, enter your details, click ok, then mount. After a few moments your share will be available. You can press cmd+r to show your share in the Finder.</p>
<p>You can now directly edit files on the sftp share using any app on your mac without the need to manually download and re-upload them.</p>
<p>If this process does not work for you, try restarting your mac, then re-adding the Macfusion share.</p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=573&amp;md5=9f4b53e1f5cf5761bb3a0d7fcac92d98" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/09/10/how-to-mount-sftpssh-shares-in-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=573&amp;md5=9f4b53e1f5cf5761bb3a0d7fcac92d98" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 8 – Connecting Mac OS X Clients to Your Ubuntu Server with Kerberos, LDAP and NFS Home Directories</title>
		<link>http://www.danbishop.org/2011/05/27/ubuntu-10-10-sbs-small-business-server-setup-part-8-%e2%80%93-adding-mac-os-x-clients-into-the-mix/</link>
		<comments>http://www.danbishop.org/2011/05/27/ubuntu-10-10-sbs-small-business-server-setup-part-8-%e2%80%93-adding-mac-os-x-clients-into-the-mix/#comments</comments>
		<pubDate>Fri, 27 May 2011 18:18:47 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=423</guid>
		<description><![CDATA[Sadly, it&#8217;s inevitable (until the resolution of bug number 1) that many organisations will use software only available for platforms other than Ubuntu. This section of the guide is going to look at adding Macs to your network. Changes to the Server At present, Mac OS X (10.6 and below) does not support NFSv4. There [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/27/ubuntu-10-10-sbs-small-business-server-setup-part-8-%e2%80%93-adding-mac-os-x-clients-into-the-mix/" size="small" count="true"></div></div><p>Sadly, it&#8217;s inevitable (until the resolution of <a href="https://bugs.launchpad.net/ubuntu/+bug/1" onclick="pageTracker._trackPageview('/outgoing/bugs.launchpad.net/ubuntu/+bug/1?referer=');">bug number 1</a>) that many organisations will use software only available for platforms other than Ubuntu. This section of the guide is going to look at adding Macs to your network.</p>
<h2>Changes to the Server</h2>
<p>At present, Mac OS X (10.6 and below) does not support NFSv4. There is alpha support, but only when mounting manually, not when using automount. In short, that means we need to make sure our server is capable of using NFSv3 alongside NFSv4.</p>
<p>If you&#8217;ve followed the rest of this guide to setup your server, there&#8217;s nothing to do here you can skip straight to configuring your mac! <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If your /etc/exports file looks something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/export         gss/krb5(rw,fsid=0,async,subtree_check,no_root_squash,crossmnt)
/export/home   gss/krb5(rw,sync,no_subtree_check)</pre></div></div>

<p>Where the export lines contain gss/krb5(&#8230;.) then you need to change them. This is a deprecated way of exporting NFS shares, but unfortunately lots of other guides still use it. You need to change the above lines to look like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/export *(rw,fsid=0,crossmnt,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)
/export/home *(rw,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)</pre></div></div>

<p>Note the insecure option. This is required for OS X to be able to connect. It&#8217;s not as bad as it sounds though! You&#8217;ll still be using Kerberos, so your system will still be secure, it just means that ports above 1024 can be used.  See this relevant snippet from &#8220;man mount_nfs&#8221; on OS X:</p>
<blockquote><p>resvport<br />
Use a reserved socket port number. This is useful for mounting<br />
servers that require clients to use a reserved port number on the<br />
mistaken belief that this makes NFS more secure. (For the rare<br />
case where the client has a trusted root account but untrustwor-<br />
thy users and the network cables are in secure areas this does<br />
help, but for normal desktop clients this does not apply.)</p></blockquote>
<p>All that remains to do on the server now, is restart NFS:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service nfs-kernel-server restart</pre></div></div>

<h2>Configuring the Mac</h2>
<h3>Kerberos</h3>
<p>Open the terminal from finder at Applications/Utilities/Terminal and create a /Library/Preferences/edu.mit.Kerberos file as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Preferences<span style="color: #000000; font-weight: bold;">/</span>edu.mit.Kerberos</pre></div></div>

<p>This file will be completely empty so we only need to add basic information like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[libdefaults]
	default_realm = DANBISHOP.ORG
	dns_lookup_kdc = true
	forwardable = true
	noaddresses = true
	allow_weak_crypto = true
[realms]
	DANBISHOP.ORG = {
		kdc = neo.danbishop.org
		admin_server = neo.danbishop.org
	}</pre></div></div>

<p>Remembering of course to change the realm information to math your own!</p>
<p>Now we need to enable Kerberos authentication for login. This is done by modifying the /private/etc/authorization file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization_orig
<span style="color: #c20cb9; font-weight: bold;">sudo</span> pico <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization</pre></div></div>

<p>Press ctrl+W to begin a search, then enter system.login.console</p>
<p>You will get something like this depending on which version of OS X you are using:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">...
                &lt;key&gt;system.login.console&lt;/key&gt;
                &lt;dict&gt;
                        &lt;key&gt;class&lt;/key&gt;
                        &lt;string&gt;evaluate-mechanisms&lt;/string&gt;
                        &lt;key&gt;comment&lt;/key&gt;
                        &lt;string&gt;Login mechanism based rule.  Not for general us$
                        &lt;key&gt;mechanisms&lt;/key&gt;
                        &lt;array&gt;
                                &lt;string&gt;builtin:smartcard-sniffer,privileged&lt;/s$
                                &lt;string&gt;loginwindow:login&lt;/string&gt;
                                &lt;string&gt;builtin:reset-password,privileged&lt;/stri$
                                &lt;string&gt;builtin:auto-login,privileged&lt;/string&gt;
                                &lt;string&gt;builtin:authenticate,privileged&lt;/string&gt;
                                &lt;string&gt;loginwindow:success&lt;/string&gt;
                                &lt;string&gt;HomeDirMechanism:login,privileged&lt;/stri$
                                &lt;string&gt;HomeDirMechanism:status&lt;/string&gt;
                                &lt;string&gt;MCXMechanism:login&lt;/string&gt;
                                &lt;string&gt;loginwindow:done&lt;/string&gt;
                        &lt;/array&gt;
...</pre></div></div>

<p>For Tiger (Mac OS X 10.4.x), change:<br />
From:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;string&gt;authinternal&lt;/string&gt;</pre></div></div>

<p>To:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;string&gt;builtin:krb5authnoverify,privileged&lt;/string&gt;</pre></div></div>

<p>For Leopard (Mac OS X 10.5.x) or greater, change: </p>
<p>From:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;string&gt;builtin:authenticate,privileged&lt;/string&gt;</pre></div></div>

<p>To:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;string&gt;builtin:krb5authnoverify,privileged&lt;/string&gt;</pre></div></div>

<p>There may be multiple occurrences of &#8216;authinternal&#8217; or &#8216;authenticate&#8217; in the /etc/authorization file. Make sure you change the correct one!</p>
<p>Now we&#8217;re going to create a kerberos principal for NFS on the Mac and then add it to the Mac&#8217;s Kerberos keytab:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kadmin <span style="color: #660033;">-p</span> dan<span style="color: #000000; font-weight: bold;">/</span>admin <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;addprinc -randkey nfs/dan-macmini.danbishop.org&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> kadmin <span style="color: #660033;">-p</span> dan<span style="color: #000000; font-weight: bold;">/</span>admin <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;ktadd nfs/dan-desktop.danbishop.org&quot;</span></pre></div></div>

<h3>LDAP</h3>
<p>Now we need to configure OS X so that it knows how to find user details from our Ubuntu LDAP server. To do this we use the directory utility. In OS X Snow Leopard (10.6) this is found by going to System Preferences/Accounts/Login Options then clicking the join button by &#8220;Network Account Server:&#8221;. On the window that pops up, click &#8220;Open Directory Utility&#8221;.</p>
<p>Select LDAPv3 from the services list and click the edit icon (the pencil). Click show options and press the &#8220;New&#8221; button followed by the &#8220;Manual&#8221; button.</p>
<p>Now it&#8217;s time to enter the settings&#8230; you can set anything you like as the configuration name. For the server name enter the address of your LDAP server (&#8220;neo.danbishop.org&#8221; in my case). For LDAP Mappings you must select RFC 2307 (Unix). When you do this you will be prompted to enter the search base. This is your domain in ldap format&#8230; e.g. &#8220;dc=danbishop,dc=org&#8221;.</p>
<p>Leave SSL unticked (unless you know what you&#8217;re doing) and click OK.</p>
<p>Now we need to edit the search policy. Click the search policy button at the top of the Directory Utility and change the search dropdown from &#8220;Automatic&#8221; to &#8220;Custom Path&#8221;. Click on the + button that appears under the list of Directory Domains. You should see the domain we just setup listed as available. Click add, then apply. We&#8217;re done with the Directory Utility now <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>NFS</h3>
<p>Try as I might, I cannot get the OS X automounter to work with this setup <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Any suggestions would be VERY welcome!</p>
<p>Meanwhile, we can mount the entire /home directory at boot (though Kerberos will prevent unauthorised access!) by going to the Disk Utility (spotlight it if you can&#8217;t find it) then selecting File/NFS Mounts&#8230;</p>
<p>Click the plus icon and enter the following two settings:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Remote NFS URL: nfs://neo.danbishop.org/export/home
Mount Location: /home</pre></div></div>

<p>Reboot the Mac and you&#8217;re done <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You can read about my efforts so far with the automounter below:</p>
<h3>NFS and Automounts</h3>
<p><strong>PLEASE NOTE: THIS DOES NOT CURRENTLY WORK!</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>auto_home</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#
# Automounter map for /home
#
#+auto_home     # Use directory service</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#
# Automounter map for /home
#
#+auto_home     # Use directory service
*   -fstype=nfs,sec=krb5   neo.danbishop.org:/export/home/&amp;</pre></div></div>

<p>Restart the Mac and you&#8217;re good to go! <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>References</h2>
<p><a href="http://clc.its.psu.edu/UnivServices/itadmins/mac/kerbldaplogins" onclick="pageTracker._trackPageview('/outgoing/clc.its.psu.edu/UnivServices/itadmins/mac/kerbldaplogins?referer=');">http://clc.its.psu.edu/UnivServices/itadmins/mac/kerbldaplogins</a><br />
h<a href="http://krypted.com/mac-os-x-server/nfs-ubuntu-mac-os-x-clients-a-quickie/" onclick="pageTracker._trackPageview('/outgoing/krypted.com/mac-os-x-server/nfs-ubuntu-mac-os-x-clients-a-quickie/?referer=');">ttp://krypted.com/mac-os-x-server/nfs-ubuntu-mac-os-x-clients-a-quickie/</a></p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=423&amp;md5=75c54460c305d0355f0d1ac37e06c898" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/05/27/ubuntu-10-10-sbs-small-business-server-setup-part-8-%e2%80%93-adding-mac-os-x-clients-into-the-mix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=423&amp;md5=75c54460c305d0355f0d1ac37e06c898" type="text/html" />
	</item>
		<item>
		<title>Make Windows the Default Operating System in Grub2&#8230; even after Ubuntu updates&#8230;</title>
		<link>http://www.danbishop.org/2011/05/26/make-windows-the-default-operating-system-in-grub2-even-after-ubuntu-updates/</link>
		<comments>http://www.danbishop.org/2011/05/26/make-windows-the-default-operating-system-in-grub2-even-after-ubuntu-updates/#comments</comments>
		<pubDate>Thu, 26 May 2011 09:06:58 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[grub2]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=560</guid>
		<description><![CDATA[Many guides for changing the default operating system for Grub2 to boot involve setting the number indicating where in the list that OS appears&#8230; unfortunately, when kernel updates are released for Ubuntu they shift everything down two places and your default OS therefore changes. Fortunately, it is possible to set the default by name First [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/26/make-windows-the-default-operating-system-in-grub2-even-after-ubuntu-updates/" size="small" count="true"></div></div><p>Many guides for changing the default operating system for Grub2 to boot involve setting the number indicating where in the list that OS appears&#8230; unfortunately, when kernel updates are released for Ubuntu they shift everything down two places and your default OS therefore changes.</p>
<p>Fortunately, it is possible to set the default by name <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First we need to obtain the exact name of the OS you wish to boot by running the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">fgrep</span> menuentry <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>grub.cfg</pre></div></div>

<p>You&#8217;ll get something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">menuentry <span style="color: #ff0000;">'Ubuntu, with Linux 2.6.38-8-generic'</span> <span style="color: #660033;">--class</span> ubuntu <span style="color: #660033;">--class</span> gnu-linux <span style="color: #660033;">--class</span> gnu <span style="color: #660033;">--class</span> os <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry <span style="color: #ff0000;">'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)'</span> <span style="color: #660033;">--class</span> ubuntu <span style="color: #660033;">--class</span> gnu-linux <span style="color: #660033;">--class</span> gnu <span style="color: #660033;">--class</span> os <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry <span style="color: #ff0000;">&quot;Memory test (memtest86+)&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry <span style="color: #ff0000;">&quot;Memory test (memtest86+, serial console 115200)&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry <span style="color: #ff0000;">&quot;Mac OS X (32-bit) (on /dev/sda2)&quot;</span> <span style="color: #660033;">--class</span> osx <span style="color: #660033;">--class</span> darwin <span style="color: #660033;">--class</span> os <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry <span style="color: #ff0000;">&quot;Mac OS X (64-bit) (on /dev/sda2)&quot;</span> <span style="color: #660033;">--class</span> osx <span style="color: #660033;">--class</span> darwin <span style="color: #660033;">--class</span> os <span style="color: #7a0874; font-weight: bold;">&#123;</span>
menuentry “Windows Vista <span style="color: #7a0874; font-weight: bold;">&#40;</span>loader<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>on <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1<span style="color: #7a0874; font-weight: bold;">&#41;</span>” <span style="color: #7a0874; font-weight: bold;">&#123;</span></pre></div></div>

<p>Now edit /etc/default/grub:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>grub</pre></div></div>

<p>The default file looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'
&nbsp;
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2&gt; /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=&quot;quiet splash&quot;
GRUB_CMDLINE_LINUX=&quot;&quot;
&nbsp;
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM=&quot;0x01234567,0xfefefefe,0x89abcdef,0xefefefef&quot;
&nbsp;
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
&nbsp;
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
&nbsp;
&nbsp;
# Uncomment if you don't want GRUB to pass &quot;root=UUID=xxx&quot; parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
&nbsp;
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=&quot;true&quot;
&nbsp;
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=&quot;480 440 1&quot;</pre></div></div>

<p>In order to set Windows Vista to be the default (I know, I know&#8230; who in their right mind?!&#8230; but still&#8230;) you need to change the line that reads GRUB_DEFAULT=0 to be like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">GRUB_DEFAULT=”Windows Vista (loader) (on /dev/sda1)”</pre></div></div>

<p>Basically copying and pasting everything in quotes (including the quotes!) for the entry you want to be the default.</p>
<p>The final step is to exit and save, then update grub with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> update-grub</pre></div></div>

 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=560&amp;md5=df60c1055f588bccfeac9fcef9a3fb02" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/05/26/make-windows-the-default-operating-system-in-grub2-even-after-ubuntu-updates/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=560&amp;md5=df60c1055f588bccfeac9fcef9a3fb02" type="text/html" />
	</item>
		<item>
		<title>How To Generate An SSH Keypair To Allow Password-less Logins</title>
		<link>http://www.danbishop.org/2011/04/03/how-to-generate-an-ssh-keypair-to-allow-password-less-logins/</link>
		<comments>http://www.danbishop.org/2011/04/03/how-to-generate-an-ssh-keypair-to-allow-password-less-logins/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 21:37:36 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=443</guid>
		<description><![CDATA[It&#8217;s quite common to need to use SSH in scripts, particularly for backup purposes. Unfortunately, this would mean storing a password in the script, which would consequently appear in logs etc&#8230; A much better plan is to use SSH keypairs. Once you&#8217;ve created a passphrase-less keypair and copied it to both machines, you can login [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/04/03/how-to-generate-an-ssh-keypair-to-allow-password-less-logins/" size="small" count="true"></div></div><p>It&#8217;s quite common to need to use SSH in scripts, particularly for backup purposes. Unfortunately, this would mean storing a password in the script, which would consequently appear in logs etc&#8230; A much better plan is to use SSH keypairs. Once you&#8217;ve created a passphrase-less keypair and copied it to both machines, you can login without a password.</p>
<p>Firstly SSH into the machine you want to be able to access without a password. In this case, username dan connecting to machine neo.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> neo <span style="color: #660033;">-l</span> dan</pre></div></div>

<p>Now create the keypair with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> rsa</pre></div></div>

<p>When asked for a passphrase, simply hit enter for none.</p>
<p>Now quit the ssh session with &#8220;exit&#8221; and run the following on the machine you want to have password-less access:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ssh-copy-id <span style="color: #660033;">-i</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub dan<span style="color: #000000; font-weight: bold;">@</span>neo</pre></div></div>

<p>All done <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can now type &#8220;ssh neo&#8221; and it will log you straight in without asking for your password! <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=443&amp;md5=f865999ccfeb8f6a74fd983c465097b1" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/04/03/how-to-generate-an-ssh-keypair-to-allow-password-less-logins/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=443&amp;md5=f865999ccfeb8f6a74fd983c465097b1" type="text/html" />
	</item>
		<item>
		<title>ASUS Upside Down Webcam in Ubuntu?</title>
		<link>http://www.danbishop.org/2011/03/27/asus-upside-down-webcam-in-ubuntu/</link>
		<comments>http://www.danbishop.org/2011/03/27/asus-upside-down-webcam-in-ubuntu/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 17:40:23 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=439</guid>
		<description><![CDATA[If you notice your webcam is upside down on skype/flash but fine on everything else, there&#8217;s a good chance the following will solve your problem. Simply run this command in a terminal, followed by the program you want to run. For example for skype: export LD_PRELOAD=/usr/lib32/libv4l/v4l1-compat.so skype Or export LD_PRELOAD=/usr/lib32/libv4l/v4l1-compat.so chromium-browser Note that the path [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/03/27/asus-upside-down-webcam-in-ubuntu/" size="small" count="true"></div></div><p>If you notice your webcam is upside down on skype/flash but fine on everything else, there&#8217;s a good chance the following will solve your problem.</p>
<p>Simply run this command in a terminal, followed by the program you want to run. For example for skype:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_PRELOAD</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libv4l<span style="color: #000000; font-weight: bold;">/</span>v4l1-compat.so
skype</pre></div></div>

<p>Or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_PRELOAD</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libv4l<span style="color: #000000; font-weight: bold;">/</span>v4l1-compat.so
chromium-browser</pre></div></div>

<p>Note that the path contains lib32 as both flash and skype are 32bit programs. If you&#8217;re actually using a 32bit version of Ubuntu you can modify the path to read: /usr/lib/libv4l/v4l1-compat.so</p>
<h2>Update: Name change for 11.04+</h2>
<p>If you&#8217;re using Ubuntu 11.04 (Natty) or above you need to use the following instead:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_PRELOAD</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libv4l<span style="color: #000000; font-weight: bold;">/</span>v4l1compat.so
skype</pre></div></div>

<p>Or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_PRELOAD</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libv4l<span style="color: #000000; font-weight: bold;">/</span>v4l1compat.so
chromium-browser</pre></div></div>

 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=439&amp;md5=73f67a0d9317e75aa357e3569d98106b" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/03/27/asus-upside-down-webcam-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=439&amp;md5=73f67a0d9317e75aa357e3569d98106b" type="text/html" />
	</item>
		<item>
		<title>Reset Mac OS X Admin Password</title>
		<link>http://www.danbishop.org/2011/03/26/reset-os-x-admin-password/</link>
		<comments>http://www.danbishop.org/2011/03/26/reset-os-x-admin-password/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 10:29:08 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=437</guid>
		<description><![CDATA[Forgotten the admin password on your Mac? You can reset the welcome system that you usually get immediately after installing OS X (the welcome video followed by the lengthy, intrusive set of forms) to create a new admin account using the following steps: Reboot Hold command + s as soon as you hear the chime [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/03/26/reset-os-x-admin-password/" size="small" count="true"></div></div><p>Forgotten the admin password on your Mac? You can reset the welcome system that you usually get immediately after installing OS X (the welcome video followed by the lengthy, intrusive set of forms) to create a new admin account using the following steps:</p>
<ol>
<li>Reboot</li>
<li>Hold command + s as soon as you hear the chime</li>
<li>You will be presented with a super user prompt, enter the following:</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-uw</span> <span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span>.AppleSetupDone
reboot</pre></div></div>

<p>After rebooting and following the welcome process, you will have a new admin account. Login as the new admin and reset the old admin&#8217;s password, you can then log in as the old admin and delete the new admin account.</p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=437&amp;md5=cbf99245a10a84e45460f310bc0522b7" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/03/26/reset-os-x-admin-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=437&amp;md5=cbf99245a10a84e45460f310bc0522b7" type="text/html" />
	</item>
		<item>
		<title>Create Your Own Local Mirror of the Ubuntu Repositories</title>
		<link>http://www.danbishop.org/2011/03/11/create-your-own-local-mirror-of-the-ubuntu-repositories/</link>
		<comments>http://www.danbishop.org/2011/03/11/create-your-own-local-mirror-of-the-ubuntu-repositories/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 11:14:19 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=392</guid>
		<description><![CDATA[If you have several Ubuntu machines on a network, you might like to mirror the Ubuntu repositories locally so that you&#8217;re not wasting bandwidth downloading the same packages from the internet for every single machine. If you&#8217;ve already got an Ubuntu server up and running for some other task (such as ldap+kerberos+nfs type server, or [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/03/11/create-your-own-local-mirror-of-the-ubuntu-repositories/" size="small" count="true"></div></div><p>If you have several Ubuntu machines on a network, you might like to mirror the Ubuntu repositories locally so that you&#8217;re not wasting bandwidth downloading the same packages from the internet for every single machine. If you&#8217;ve already got an Ubuntu server up and running for some other task (such as ldap+kerberos+nfs type server, or a local web server) it&#8217;s very easy to add mirroring repository functionality to it. All you need is a spare ten minutes and ~35GB of free space for main, universe and multiverse and ~70GB if you also want the source packages (deb-src).<span id="more-392"></span></p>
<p>First step is to install apt-mirror:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apt-mirror</pre></div></div>

<p>Now let&#8217;s edit the configuration file for apt-mirror:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>mirror.list</pre></div></div>

<p>The default configuration is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">############# config ##################
#
# set base_path    /var/spool/apt-mirror
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  &lt;running host architecture&gt;
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############
&nbsp;
deb http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse
&nbsp;
deb-src http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse
&nbsp;
clean http://archive.ubuntu.com/ubuntu</pre></div></div>

<p>You can add extra repositories to the list, in the same format as the existing ones if you want to mirror these too. You can also change the path where you want the mirrored deb files to be stored. In my case I had a /spare partition set aside for future use and this is just perfect, so I&#8217;ve uncommented set base_path and changed /var/&#8230; to /spare. You may also like to remove the deb-src entries if you&#8217;re low on space unless you frequently use these to rebuild packages.</p>
<p>To specify the architecture that you want to mirror for use deb-i386 or deb-amd64 as the line prefix. You can also insert use a country code to specify that your mirror should be built from a mirror in your own country. This should make both your initial download and subsequent downloads much faster. To do this for the UK for example, use http://gb.archive.ubuntu.com/ubuntu</p>
<p>My final /etc/apt/mirror.list (which requires 52.0 GB of space) is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">############# config ##################
#
set base_path    /spare
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  &lt;running host architecture&gt;
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############
&nbsp;
deb-amd64 http://gb.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb-amd64 http://gb.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-amd64 http://gb.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
#deb http://gb.archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
#deb http://gb.archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse
&nbsp;
deb-i386 http://gb.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb-i386 http://gb.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-i386 http://gb.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
&nbsp;
&nbsp;
clean http://gb.archive.ubuntu.com/ubuntu</pre></div></div>

<p>Having changed the base_directory, I need to create some directories under /spare like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>spare<span style="color: #000000; font-weight: bold;">/</span>mirror
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>spare<span style="color: #000000; font-weight: bold;">/</span>skel
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>spare<span style="color: #000000; font-weight: bold;">/</span>var</pre></div></div>

<p>Now we can perform our first manual update of the mirror by running the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-mirror <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>mirror.list</pre></div></div>

<p>If you&#8217;ve made a mistake with the config file and apt-mirror quits unexpectedly, you might find that the next time you run it you get the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">apt-mirror is already running, exiting at <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apt-mirror line <span style="color: #000000;">187</span>.</pre></div></div>

<p>If this is the case and you&#8217;re sure that apt-mirror is not running, then delete the lock file at /spare/var/apt-mirror.lock</p>
<h2>Cron</h2>
<p>In order to keep the mirror up-to-date automatically, we need to set up a cron job. Apt-mirror installs an example cron job at /etc/cron.d/apt-mirror:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#
# Regular cron jobs for the apt-mirror package
#
# 0 4     * * *   apt-mirror      /usr/bin/apt-mirror &gt; /var/spool/apt-mirror/var/cron.log</pre></div></div>

<p>If you remove the comment from the front of the last line, this will cause the mirror to be updated every day at 4am. If you want to change this you can read more about how cron jobs work <a href="http://en.wikipedia.org/wiki/Cron#Examples" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Cron_Examples?referer=');">here</a>.</p>
<h2>Apache &#8211; Configuring your mirror for http access</h2>
<p>Ubuntu clients generally access repositories over http, we can set our mirror up for http access using apache2. If you&#8217;ve not already installed apache on your server, use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2</pre></div></div>

<p>Now we need to create a symbolic link from our repository mirror, to a directory served by apache:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>spare<span style="color: #000000; font-weight: bold;">/</span>mirror<span style="color: #000000; font-weight: bold;">/</span>gb.archive.ubuntu.com<span style="color: #000000; font-weight: bold;">/</span>ubuntu<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>ubuntu</pre></div></div>

<h2>Clients</h2>
<p>To get your clients to use the new mirror, simply update /etc/apt/sources.list with the new paths, for example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release amd64 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
&nbsp;
deb http://neo.danbishop.org/ubuntu/ maverick main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick main restricted
&nbsp;
## Major bug fix updates produced after the final release of the
## distribution.
deb http://neo.danbishop.org/ubuntu/ maverick-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates main restricted
&nbsp;
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://neo.danbishop.org/ubuntu/ maverick universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick universe
deb http://neo.danbishop.org/ubuntu/ maverick-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates universe
&nbsp;
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://neo.danbishop.org/ubuntu/ maverick multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick multiverse
deb http://neo.danbishop.org/ubuntu/ maverick-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates multiverse
&nbsp;
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
&nbsp;
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu maverick partner
# deb-src http://archive.canonical.com/ubuntu maverick partner
&nbsp;
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick multiverse
deb http://neo.danbishop.org/ubuntu/ maverick-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-updates multiverse
&nbsp;
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
&nbsp;
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu maverick partner
# deb-src http://archive.canonical.com/ubuntu maverick partner
&nbsp;
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu maverick main
deb-src http://extras.ubuntu.com/ubuntu maverick main
&nbsp;
deb http://security.ubuntu.com/ubuntu maverick-security main restricted
deb-src http://security.ubuntu.com/ubuntu maverick-security main restricted
deb http://security.ubuntu.com/ubuntu maverick-security universe
deb-src http://security.ubuntu.com/ubuntu maverick-security universe
deb http://security.ubuntu.com/ubuntu maverick-security multiverse
#deb http://gb.archive.ubuntu.com/ubuntu/ maverick-proposed restricted main multiverse universe
deb-src http://security.ubuntu.com/ubuntu maverick-security multiverse</pre></div></div>

 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=392&amp;md5=9d6e04255e47fd9d5f8a70826f2f1c85" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/03/11/create-your-own-local-mirror-of-the-ubuntu-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=392&amp;md5=9d6e04255e47fd9d5f8a70826f2f1c85" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 10.10 SBS (Small Business Server) Setup: Part 7 – Setting Up Clients</title>
		<link>http://www.danbishop.org/2011/02/15/ubuntu-10-10-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/</link>
		<comments>http://www.danbishop.org/2011/02/15/ubuntu-10-10-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 22:02:12 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=352</guid>
		<description><![CDATA[This is part of a guide to setting up an Ubuntu server for a small/medium business. The server will provide DHCP, DNS, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network. Part 1 &#8211; [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/02/15/ubuntu-10-10-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/" size="small" count="true"></div></div><p>This is part of a guide to setting up an Ubuntu server for a small/medium business. The server will provide DHCP, DNS, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network.</p>
<ul>
<ol><a href="http://www.danbishop.org/?p=267">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=291">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=301">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=318">Part 4 – OpenLDAP Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=332">Part 5 – Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=338">Part 6 – NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=352">Part 7 – Setting Up Clients</a></ol>
</ul>
<p>The clients are going to be configured so that they mount home directories from the server and verify usernames/password using ldap and kerberos.<span id="more-352"></span></p>
<p>I will not cover installing Ubuntu Desktop on the client as there are hundreds of guides for this already, however, whilst installing I recommend you create a local user named &#8220;localadmin&#8221;. We will use this account to configure the client.</p>
<p>First we need to install some packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> krb5-user libpam-krb5 libnss-ldapd nfs-common</pre></div></div>

<p>If you&#8217;ve been following this guide from the beginning, you may not be prompted for some of the following information as it is provided by your DHCP server as configured earlier.</p>
<p>If asked to enter your default Kerberos Version 5 realm enter: &#8220;DANBISHOP.ORG&#8221;</p>
<p>You might then be asked for the address of the kerberos server: &#8220;neo.danbishop.org&#8221;</p>
<p>The address of the administrative server: &#8220;neo.danbishop.org&#8221;</p>
<p>The address of your ldap server: &#8220;ldap://neo.danbishop.org/&#8221;</p>
<p>LDAP server search base: &#8220;dc=danbishop,dc=org&#8221;</p>
<p>Finally, name services to configure. Make sure you select both group and passwd!</p>
<p>Run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pam-auth-update</pre></div></div>

<p>And ensure that LDAP and Kerberos are selected.</p>
<p>Now to configure idmapd so that the client correctly maps user and group names to ids, to do this you simply need to change the domain to match your own in /etc/idmapd.conf like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>idmapd.conf</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[General]
&nbsp;
Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = danbishop.org
&nbsp;
[Mapping]
&nbsp;
Nobody-User = nobody
Nobody-Group = nogroup</pre></div></div>

<p>Now for the home directories&#8230;</p>
<p>Although we have configured everything so that clients can get kerberos settings from DNS&#8230; kadmin does not fully support this <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>This means we&#8217;re going to have to make a small change to /etc/krb5.conf on the clients to make the following steps a LOT easier.</p>
<p>Add the following to the [realms] section of /etc/krb5.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[realms]
         DANBISHOP.ORG = {
             kdc = neo.danbishop.org
             admin_server = neo.danbishop.org
             master_kdc = neo.danbishop.org
             default_domain = danbishop.org
         }</pre></div></div>

<p>Now we&#8217;re going to create a kerberos principal for NFS on the client like so:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kadmin <span style="color: #660033;">-p</span> dan<span style="color: #000000; font-weight: bold;">/</span>admin <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;addprinc -randkey nfs/dan-desktop.danbishop.org&quot;</span></pre></div></div>

<p>Having specified the admin server in /etc/krb5.conf we can run these command directly from the client.</p>
<p>Now we need to add the principal that&#8217;s just been created on the server, to the keytab file on the client:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> kadmin <span style="color: #660033;">-p</span> dan<span style="color: #000000; font-weight: bold;">/</span>admin <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;ktadd nfs/dan-desktop.danbishop.org&quot;</span></pre></div></div>

<p>Sadly, there is one final change that needs to be made to /etc/krb5.conf. We need to allow weak encryption for Kerberos in order for NFS to work. This should soon be fixed (11.04?) and if you&#8217;re interested in why this is the case there are numerous bug reports on launchpad. For now though add the following to the [libdefaults] section of /etc/krb5.conf:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">allow_weak_crypto = true</pre></div></div>

<h2>Configuring NFS</h2>
<p>NFS needs to be configured to use kerberos by editing /etc/default/nfs-common:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are &quot;yes&quot; and &quot;no&quot;.
&nbsp;
# Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD=
&nbsp;
# Options for rpc.statd.
#   Should rpc.statd listen on a specific port? This is especially useful
#   when you have a port-based firewall. To use a fixed port, set this
#   this variable to a statd argument like: &quot;--port 4000 --outgoing-port 4001&quot;.
#   For more information, see rpc.statd(8) or http://wiki.debian.org/?SecuringNFS
STATDOPTS=
&nbsp;
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD=yes
&nbsp;
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=yes</pre></div></div>

<p>Note that NEED_IDMAPD and NEED_GSSD have been set to yes.</p>
<h2>AutoFS</h2>
<p>Now we&#8217;re going to install and configure autofs to mount home directories on login.</p>
<p>Install the autofs package:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> autofs</pre></div></div>

<p>To configure autofs we will edit /etc/auto.master.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>auto.master</pre></div></div>

<p>Here is the sample file provided by Ubuntu:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       &quot;nosuid&quot; and &quot;nodev&quot; options unless the &quot;suid&quot; and &quot;dev&quot;
#       options are explicitly given.
#
#/net   -hosts
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master</pre></div></div>

<p>As you can see, everything except the last line is commented out. COMMENT OUT THE LAST LINE. Then take note of the format used by the examples. Each mount point is associated with another configuration file. We will create a new configuration file for our NFS share(s).</p>
<p>Add the following line at the end of /etc/auto.master:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/home   /etc/auto.nfs</pre></div></div>

<p>This creates a mount point at /home and configures it according to the settings specified in /etc/auto.nfs (which we are about to create).</p>
<p>Now we will create the file which countains our automounter map:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>auto.nfs</pre></div></div>

<p>This file should contain a separate line for each NFS share. The format for a line is {mount point} [{mount options}] {location}.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">*   -fstype=nfs4,rw,sec=krb5   neo.danbishop.org:/home/&amp;</pre></div></div>

<p>This will automount any directory you try to access in /home allowing any user to login <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All that remains is to restart automount (personally I&#8217;d just reboot the machine) by running:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> service autofs restart</pre></div></div>

<p>You&#8217;re done! <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=352&amp;md5=5a99abb44138f8382c7f38df76986349" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/02/15/ubuntu-10-10-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=352&amp;md5=5a99abb44138f8382c7f38df76986349" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 10.10 SBS (Small Business Server) Setup: Part 6 – NFS</title>
		<link>http://www.danbishop.org/2011/02/06/ubuntu-10-10-sbs-small-business-server-setup-part-6-%e2%80%93-nfs/</link>
		<comments>http://www.danbishop.org/2011/02/06/ubuntu-10-10-sbs-small-business-server-setup-part-6-%e2%80%93-nfs/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 11:25:21 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=338</guid>
		<description><![CDATA[This is part of a guide to setting up an Ubuntu server for a small/medium business. The server will provide DHCP, DNS, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network. Part 1 &#8211; [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/02/06/ubuntu-10-10-sbs-small-business-server-setup-part-6-%e2%80%93-nfs/" size="small" count="true"></div></div><p>This is part of a guide to setting up an Ubuntu server for a small/medium business. The server will provide DHCP, DNS, LDAP, Kerberos and NFS services such that users can login to any machine on the network and all their files and settings will be the same across the entire network.</p>
<ul>
<ol><a href="http://www.danbishop.org/?p=267">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=291">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=301">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=318">Part 4 – OpenLDAP Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=332">Part 5 – Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=338">Part 6 – NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=352">Part 7 – Setting Up Clients</a></ol>
</ul>
<p>This section will help you configure NFS using Kerberos to secure it.<span id="more-338"></span></p>
<p>The first step is to install the following NFS packages:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nfs-kernel-server nfs-common</pre></div></div>

<p>NFSv4 uses a pseudo filesystem by mounting the real directories you want to export under an export folder using the -bind mount option. We need to create this folder system as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">export</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>export<span style="color: #000000; font-weight: bold;">/</span>home</pre></div></div>

<p>In order to mount /home under /export/home each time the system boots, we need to modify /etc/fstab by adding the following line to the bottom of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>home    <span style="color: #000000; font-weight: bold;">/</span>export<span style="color: #000000; font-weight: bold;">/</span>home   none    <span style="color: #7a0874; font-weight: bold;">bind</span>  <span style="color: #000000;">0</span>  <span style="color: #000000;">0</span></pre></div></div>

<p>This will take care of mounting the directories next time he server reboots, but for now we can manually mount it using:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>export<span style="color: #000000; font-weight: bold;">/</span>home</pre></div></div>

<p>Next we&#8217;re going to tell NFS what it should export by configuring the /etc/exports file like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/export *(rw,fsid=0,crossmnt,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)
/export/home *(rw,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)</pre></div></div>

<p>Now we have to tell NFS to use Kerberos first by setting the following options in /etc/default/nfs-common:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">NEED_STATD=
STATDOPTS=
NEED_IDMAPD=yes
NEED_GSSD=yes</pre></div></div>

<p>Then by setting the following options in /etc/default/nfs-kernel-server:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">RPCNFSDCOUNT=8
RPCNFSDPRIORITY=0
RPCMOUNTDOPTS=--manage-gids
NEED_SVCGSSD=yes
RPCSVCGSSDOPTS=</pre></div></div>

<p>/etc/idmapd.conf needs to configured with the correct domain name for user/group name mappings:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[General]
&nbsp;
Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = danbishop.org
&nbsp;
[Mapping]
&nbsp;
Nobody-User = nobody
Nobody-Group = nogroup</pre></div></div>

<p>Next we need to create kerberos principals for the NFS server.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kinit dan<span style="color: #000000; font-weight: bold;">/</span>admin
kadmin <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;addprinc -randkey nfs/neo.danbishop.org&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> kadmin.local <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;ktadd nfs/neo.danbishop.org&quot;</span></pre></div></div>

<p>sudo kadmin.local is used here as you need sudo privileges to write to /etc/krb5.keytab.</p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=338&amp;md5=51db12a1602b41270032454761e5d732" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/02/06/ubuntu-10-10-sbs-small-business-server-setup-part-6-%e2%80%93-nfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=338&amp;md5=51db12a1602b41270032454761e5d732" type="text/html" />
	</item>
	</channel>
</rss>

