<?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; ubuntu</title>
	<atom:link href="http://www.danbishop.org/tag/ubuntu/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>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>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>
		<item>
		<title>Ubuntu 10.10 SBS (Small Business Server) Setup: Part 5 – Kerberos</title>
		<link>http://www.danbishop.org/2011/02/05/ubuntu-10-10-sbs-small-business-server-setup-part-5-%e2%80%93-kerberos/</link>
		<comments>http://www.danbishop.org/2011/02/05/ubuntu-10-10-sbs-small-business-server-setup-part-5-%e2%80%93-kerberos/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 19:58:20 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></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=332</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/05/ubuntu-10-10-sbs-small-business-server-setup-part-5-%e2%80%93-kerberos/" 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>It&#8217;s time to install and configure Kerberos.<span id="more-332"></span></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-kdc krb5-admin-server</pre></div></div>

<p>The packages will automatically configure Kerberos for the correct realm from the information provided by Dnsmasq earlier in this guide. All we have to do is create the database for the realm using the following tool:</p>

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

<p>You will be asked to enter a master key for Kerberos, make sure you use something secure and memorable.</p>
<p>To configure Kerberos for NFS later, we&#8217;ll need to create an admin user.</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.local</pre></div></div>

<p>The following output should be observed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Authenticating <span style="color: #c20cb9; font-weight: bold;">as</span> principal root<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">@</span>DANBISHOP.ORG with password.
kadmin.local:</pre></div></div>

<p>Enter the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">addprinc dan<span style="color: #000000; font-weight: bold;">/</span>admin</pre></div></div>

<p>Enter a password when prompted, then quit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">WARNING: no policy specified <span style="color: #000000; font-weight: bold;">for</span> dan<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">@</span>DANBISHOP.ORG; defaulting to no policy
Enter password <span style="color: #000000; font-weight: bold;">for</span> principal <span style="color: #ff0000;">&quot;dan/admin@DANBISHOP.ORG&quot;</span>: 
Re-enter password <span style="color: #000000; font-weight: bold;">for</span> principal <span style="color: #ff0000;">&quot;dan/admin@DANBISHOP.ORG&quot;</span>: 
Principal <span style="color: #ff0000;">&quot;dan/admin@DANBISHOP.ORG&quot;</span> created.
kadmin.local: quit</pre></div></div>

<p>We need to give dan/admin admin privileges by editing the access control list for Kerberos (/etc/krb5kdc/kadm5.acl) this file should contain the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># This file Is the access control list for krb5 administration.
# When this file is edited run /etc/init.d/krb5-admin-server restart to activate
# One common way to set up Kerberos administration is to allow any principal
# ending in /admin  is given full administrative rights.
# To enable this, uncomment the following line:
*/admin *</pre></div></div>

<p>Note that the last line has been uncommented so that all /admin principals have admin rights. To get Kerberos to use the new ACL we need to restart it:</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 krb5-admin-server restart</pre></div></div>

<p>Now we can test everything has worked with:</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</pre></div></div>

<p>Enter the password you set when requested then run klist:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">klist
Ticket cache: FILE:<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>krb5cc_1000
Default principal: dan<span style="color: #000000; font-weight: bold;">/</span>admin<span style="color: #000000; font-weight: bold;">@</span>DANBISHOP.ORG
&nbsp;
Valid starting     Expires            Service principal
02<span style="color: #000000; font-weight: bold;">/</span>05<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">57</span>:<span style="color: #000000;">24</span>  02<span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span> 05:<span style="color: #000000;">57</span>:<span style="color: #000000;">24</span>  krbtgt<span style="color: #000000; font-weight: bold;">/</span>DANBISHOP.ORG<span style="color: #000000; font-weight: bold;">@</span>DANBISHOP.ORG
	renew <span style="color: #000000; font-weight: bold;">until</span> 02<span style="color: #000000; font-weight: bold;">/</span>06<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">57</span>:<span style="color: #000000;">21</span></pre></div></div>

<p>If you get output something like the above then congratulations, you have a fully functioning Kerberos Realm <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, we&#8217;ll configure /etc/krb5.conf on the server so that we can use the admin account in the same way on both the server and clients:</p>

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

<p>It will ask what to set the default Kerberos realm to, it should have detected the correct value already so just press enter and you&#8217;re done <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally, we can enable kerberos authentication to login to the server.</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> libpam-krb5
<span style="color: #c20cb9; font-weight: bold;">sudo</span> pam-auth-update</pre></div></div>

<p>Check that Kerberos is selected as an authentication method to allow users to login/ssh into the server. </p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=332&amp;md5=ab9f9392423a6ad0b69288ff290f9084" 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/05/ubuntu-10-10-sbs-small-business-server-setup-part-5-%e2%80%93-kerberos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=332&amp;md5=ab9f9392423a6ad0b69288ff290f9084" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 10.10 SBS (Small Business Server) Setup: Part 4 – OpenLDAP Account Management</title>
		<link>http://www.danbishop.org/2011/02/03/ubuntu-10-10-sbs-small-business-server-setup-part-4-%e2%80%93-openldap-account-management/</link>
		<comments>http://www.danbishop.org/2011/02/03/ubuntu-10-10-sbs-small-business-server-setup-part-4-%e2%80%93-openldap-account-management/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 15:26:06 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></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=318</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/03/ubuntu-10-10-sbs-small-business-server-setup-part-4-%e2%80%93-openldap-account-management/" 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>Now you have OpenLDAP up and running, it&#8217;s time to learn how to manage your users and groups.<span id="more-318"></span></p>
<h2>Management Scripts Configuration</h2>
<p>Firstly, we&#8217;re going to install some scripts to aid with basic management tasks:</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> ldapscripts</pre></div></div>

<p>Now we need to edit the config file /etc/ldapscripts/ldapscripts.conf uncommenting and changing the following to match your environment:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#  Copyright (C) 2005 Ganal LAPLANCHE - Linagora
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
#  USA.
&nbsp;
# Note for Debian users:
# On Debian system ldapscripts will try to parse and use some system config.
# Look on commented variables and description lines started with DEBIAN.
# But you could override it's values here.
&nbsp;
&nbsp;
# LDAP Configuration
# DEBIAN: values from /etc/pam_ldap.conf are used.
SERVER=&quot;ldap://localhost&quot;
BINDDN=&quot;cn=admin,dc=danbishop,dc=org&quot;
&nbsp;
# The following file contains the raw password of the binddn
# Create it with something like : echo -n 'secret' &gt; $BINDPWDFILE
# WARNING !!!! Be careful not to make this file world-readable
# DEBIAN: /etc/pam_ldap.secret or /etc/ldap.secret are used.
#BINDPWDFILE=&quot;/etc/ldapscripts/ldapscripts.passwd&quot;
# For older versions of OpenLDAP, it is still possible to use
# unsecure command-line passwords by defining the following option
# AND commenting the previous one (BINDPWDFILE takes precedence)
#BINDPWD=&quot;secret&quot;
&nbsp;
# DEBIAN: values from /etc/pam_ldap.conf are used.
SUFFIX=&quot;dc=danbishop,dc=org&quot; # Global suffix
GSUFFIX=&quot;ou=Groups&quot;        # Groups ou (just under $SUFFIX)
USUFFIX=&quot;ou=People&quot;         # Users ou (just under $SUFFIX)
MSUFFIX=&quot;ou=Machines&quot;      # Machines ou (just under $SUFFIX)
&nbsp;
# Start with these IDs *if no entry found in LDAP*
GIDSTART=&quot;10000&quot; # Group ID
UIDSTART=&quot;10000&quot; # User ID
MIDSTART=&quot;20000&quot; # Machine ID
&nbsp;
# User properties
# DEBIAN: values from /etc/adduser.conf are used.
#USHELL=&quot;/bin/sh&quot;
#UHOMES=&quot;/home/%u&quot;     # You may use %u for username here
CREATEHOMES=&quot;yes&quot;      # Create home directories and set rights ?
#HOMESKEL=&quot;/etc/skel&quot;  # Directory where the skeleton files are located. Ignored if undefined or nonexistant.
#HOMEPERMS=&quot;755&quot;       # Default permissions for home directories
&nbsp;
# User passwords generation
# Command-line used to generate a password for added users (you may use %u for username here)
# WARNING !!!! This is evaluated, everything specified here will be run !
# Special value &quot;&lt;ask&gt;&quot; will ask for a password interactively
#PASSWORDGEN=&quot;cat /dev/random | LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c8&quot;
#PASSWORDGEN=&quot;head -c8 /dev/random | uuencode -m - | sed -n '2s|=*$||;2p' | sed -e 's|+||g' -e 's|/||g'&quot;
PASSWORDGEN=&quot;pwgen -s&quot;
#PASSWORDGEN=&quot;echo changeme&quot;
#PASSWORDGEN=&quot;echo %u&quot;
#PASSWORDGEN=&quot;&lt;ask&gt;&quot;
&nbsp;
# User passwords recording
# you can keep trace of generated passwords setting PASSWORDFILE and RECORDPASSWORDS
# (useful when performing a massive creation / net rpc vampire)
# WARNING !!!! DO NOT FORGET TO DELETE THE GENERATED FILE WHEN DONE !
# WARNING !!!! DO NOT FORGET TO TURN OFF RECORDING WHEN DONE !
RECORDPASSWORDS=&quot;no&quot;
PASSWORDFILE=&quot;/var/log/ldapscripts_passwd.log&quot;
&nbsp;
# Where to log
LOGFILE=&quot;/var/log/ldapscripts.log&quot;
&nbsp;
# Temporary folder
TMPDIR=&quot;/tmp&quot;
&nbsp;
# Various binaries used within the scripts
# Warning : they also use uuencode, date, grep, sed, cut, expr, which... 
# Please check they are installed before using these scripts
# Note that many of them should come with your OS
&nbsp;
# OpenLDAP client commands
LDAPSEARCHBIN=&quot;/usr/bin/ldapsearch&quot;
LDAPADDBIN=&quot;/usr/bin/ldapadd&quot;
LDAPDELETEBIN=&quot;/usr/bin/ldapdelete&quot;
LDAPMODIFYBIN=&quot;/usr/bin/ldapmodify&quot;
LDAPMODRDNBIN=&quot;/usr/bin/ldapmodrdn&quot;
LDAPPASSWDBIN=&quot;/usr/bin/ldappasswd&quot;
&nbsp;
# Character set conversion : $ICONVCHAR &lt;-&gt; UTF-8
# Comment ICONVBIN to disable UTF-8 conversion
#ICONVBIN=&quot;/usr/bin/iconv&quot;
#ICONVCHAR=&quot;ISO-8859-15&quot;
&nbsp;
# Base64 decoding
# Comment UUDECODEBIN to disable Base64 decoding
#UUDECODEBIN=&quot;/usr/bin/uudecode&quot;
&nbsp;
# Getent command to use - choose the ones used
# on your system. Leave blank or comment for auto-guess.
# GNU/Linux
#GETENTPWCMD=&quot;getent passwd&quot;
#GETENTGRCMD=&quot;getent group&quot;
# FreeBSD
#GETENTPWCMD=&quot;pw usershow&quot;
#GETENTGRCMD=&quot;pw groupshow&quot;
# Auto
GETENTPWCMD=&quot;&quot;
GETENTGRCMD=&quot;&quot;
&nbsp;
# You can specify custom LDIF templates here
# Leave empty to use default templates
# See *.template.sample for default templates
#GTEMPLATE=&quot;/path/to/ldapaddgroup.template&quot;
#UTEMPLATE=&quot;/path/to/ldapadduser.template&quot;
#MTEMPLATE=&quot;/path/to/ldapaddmachine.template&quot;
GTEMPLATE=&quot;&quot;
UTEMPLATE=&quot;&quot;
MTEMPLATE=&quot;&quot;</pre></div></div>

<p>The changes from the default file are highlighted below:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Provides LDAP server's address and the admin username
SERVER=&quot;ldap://localhost&quot;
BINDDN=&quot;cn=admin,dc=danbishop,dc=org&quot;
&nbsp;
# These have all been uncommented, Users changed to People
# and the correct suffix set for our domain
SUFFIX=&quot;dc=danbishop,dc=org&quot; # Global suffix
GSUFFIX=&quot;ou=Groups&quot;        # Groups ou (just under $SUFFIX)
USUFFIX=&quot;ou=People&quot;         # Users ou (just under $SUFFIX)
MSUFFIX=&quot;ou=Machines&quot;      # Machines ou (just under $SUFFIX)
&nbsp;
# This creates home directories when we create users
CREATEHOMES=&quot;yes&quot;</pre></div></div>

<p>On Ubuntu 10.04 there is a bug that causes LONG delays when adding new users. This is to do with the random function used when creating the user&#8217;s initial password. There is a very easy work around however, simply change the line &#8220;PASSWORDGEN=&#8221;cat /dev/random | LC_ALL=C tr -dc &#8216;a-zA-Z0-9&#8242; | head -c8&#8243;&#8221; so that /dev/random reads /dev/urandom like so: &#8220;#PASSWORDGEN=&#8221;cat /dev/random | LC_ALL=C tr -dc &#8216;a-zA-Z0-9&#8242; | head -c8&#8243;&#8221;. This bug is fixed in 10.10 and as you can see PASSWORDGEN=&#8221;pwgen -s&#8221; is used instead.</p>
<p>If you&#8217;ve read through the default comments in /etc/ldapscripts/ldapscripts.conf you&#8217;ll see that it finds the LDAP admin password from a /etc/ldap.secret file. So the following two commands create that file, write our admin password to it (change PASSWORD to your admin password) and then set it to be non-world-readable. This prevents users discovering your LDAP password, but allows root, or processes running as root, to read the file and find the password.</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;">sh</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;echo -n 'PASSWORD' &gt; /etc/ldap.secret&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">400</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ldap.secret</pre></div></div>

<h2>Managing Users</h2>
<p>Now the scripts are configured we can start creating users. The first thing to do is create some groups to hold users. The first two groups we will create will be &#8220;admin&#8221; and &#8220;user&#8221;. These will later be configured so that users in the admin group can use sudo. This is done 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> ldapaddgroup admin
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapaddgroup user</pre></div></div>

<p>Next we will create a user and assign him to a group:</p>

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

<p>Set a password for the user:</p>

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

<p>And finally add the user to the admin group:</p>

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

<h2>LDAP Authentication on the Server</h2>
<p>So LDAP now contains at least one user&#8230; how do we login to the server as that user? This is actually very easy to configure, it simply requires the installation of two 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> libnss-ldapd libpam-ldapd</pre></div></div>

<p>During the configuration section of the installation, you will be asked which services you&#8217;d like to enable LDAP for, you should select &#8220;group&#8221; and &#8220;passwd&#8221;. The packages will then configure /etc/nsswitch.conf, /etc/pam.d/common-auth and /etc/nslcd.conf to work automatically.</p>
<p>To test your new user login, either logout then try to login with the credentials you created above, or of course, start a new ssh session.</p>
<h2>References</h2>
<p><a href="http://www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-alpha2" onclick="pageTracker._trackPageview('/outgoing/www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-alpha2?referer=');">http://www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-alpha2</a></p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=318&amp;md5=28b03058d31367e0cdc9a21b425766df" 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/03/ubuntu-10-10-sbs-small-business-server-setup-part-4-%e2%80%93-openldap-account-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=318&amp;md5=28b03058d31367e0cdc9a21b425766df" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 10.10 SBS (Small Business Server) Setup: Part 3 &#8211; OpenLDAP</title>
		<link>http://www.danbishop.org/2011/02/01/ubuntu-10-10-sbs-small-business-server-setup-part-3-openldap/</link>
		<comments>http://www.danbishop.org/2011/02/01/ubuntu-10-10-sbs-small-business-server-setup-part-3-openldap/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 23:35:37 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Software]]></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=301</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/01/ubuntu-10-10-sbs-small-business-server-setup-part-3-openldap/" 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>OpenLDAP is a <a href="http://en.wikipedia.org/wiki/Directory_service" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Directory_service?referer=');">directory service</a>. Think of it as a database for storing all your users, their passwords and groups. In time you can use it to store much more, but initially we&#8217;re going to use it as a centralised authorisation system. Clients will check usernames and permissions against those stored in the directory on the server. Though it is also possible to store passwords in LDAP and use it for authorisation, we&#8217;ll be using Kerberos for this purpose.<span id="more-301"></span></p>
<p>The first step is to install OpenLDAP along with some utilities for administering. We&#8217;re also going to load some basic schema (directory layouts) for storing user credentials in:</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> slapd ldap-utils
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapadd <span style="color: #660033;">-Y</span> EXTERNAL <span style="color: #660033;">-H</span> ldapi:<span style="color: #000000; font-weight: bold;">///</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>cosine.ldif
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapadd <span style="color: #660033;">-Y</span> EXTERNAL <span style="color: #660033;">-H</span> ldapi:<span style="color: #000000; font-weight: bold;">///</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>nis.ldif
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapadd <span style="color: #660033;">-Y</span> EXTERNAL <span style="color: #660033;">-H</span> ldapi:<span style="color: #000000; font-weight: bold;">///</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ldap<span style="color: #000000; font-weight: bold;">/</span>schema<span style="color: #000000; font-weight: bold;">/</span>inetorgperson.ldif</pre></div></div>

<p>OpenLDAP uses a separate directory to hold the cn=config Directory Information Tree (DIT). The cn=config DIT is used to dynamically configure the slapd daemon, allowing the modification of schema definitions, indices, Access Control Lists, etc without stopping the service. In older versions and configurations, a text based configuration was used, much like that for Dnsmasq above. However, in large scale deployments OpenLDAP can become an absolutely critical service. Restarting it to load a new configuration is simply not an option.</p>
<p>The backend cn=config directory has only a minimal configuration and will need additional configuration options in order to populate the frontend directory. The frontend will be populated with a &#8220;classical&#8221; scheme that will be compatible with address book applications and with Unix Posix accounts. Posix accounts will allow authentication to various applications, such as web applications, email Mail Transfer Agent (MTA) applications, etc.</p>
<p>To create the backend, we write an LDIF file (backend.danbishop.org.ldif) to be imported by OpenLDAP:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Load dynamic backend modules
dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulepath: /usr/lib/ldap
olcModuleload: back_hdb
&nbsp;
# Database settings
dn: olcDatabase=hdb,cn=config
objectClass: olcDatabaseConfig
objectClass: olcHdbConfig
olcDatabase: {1}hdb
olcSuffix: dc=danbishop,dc=org
olcDbDirectory: /var/lib/ldap
olcRootDN: cn=admin,dc=danbishop,dc=org
olcRootPW: PASSWORD
olcDbConfig: set_cachesize 0 2097152 0
olcDbConfig: set_lk_max_objects 1500
olcDbConfig: set_lk_max_locks 1500
olcDbConfig: set_lk_max_lockers 1500
olcDbIndex: objectClass eq
olcLastMod: TRUE
olcDbCheckpoint: 512 30
olcAccess: to attrs=userPassword by dn=&quot;cn=admin,dc=danbishop,dc=org&quot; write by anonymous auth by self write by * none
olcAccess: to attrs=shadowLastChange by self write by * read
olcAccess: to dn.base=&quot;&quot; by * read
olcAccess: to * by dn=&quot;cn=admin,dc=danbishop,dc=org&quot; write by * read</pre></div></div>

<p>Note the line &#8220;olcRootPW: PASSWORD&#8221;. Substitute PASSWORD with a (secure!) password of your choice!</p>
<p>Now it&#8217;s time to add the LDIF file to your directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapadd <span style="color: #660033;">-Y</span> EXTERNAL <span style="color: #660033;">-H</span> ldapi:<span style="color: #000000; font-weight: bold;">///</span> <span style="color: #660033;">-f</span> backend.danbishop.org.ldif</pre></div></div>

<p>That&#8217;s the boring configuration bit taken care of&#8230; now it&#8217;s time to create the directories for storing your users and groups. This is done by creating a similar file to the one above frontend.danbishop.org.ldif like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Create top-level object in domain 
dn: dc=danbishop,dc=org
objectClass: top
objectClass: dcObject
objectclass: organization
o: danbishop Organization
dc: danbishop
description: LDAP danbishop
&nbsp;
dn: ou=people,dc=danbishop,dc=org
objectClass: organizationalUnit
ou: people
&nbsp;
dn: ou=groups,dc=danbishop,dc=org
objectClass: organizationalUnit
ou: groups</pre></div></div>

<p>And we add the LDIF in the following way, entering your root LDAP password when prompted (PASSWORD):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ldapadd <span style="color: #660033;">-x</span> <span style="color: #660033;">-D</span> <span style="color: #007800;">cn</span>=admin,<span style="color: #007800;">dc</span>=danbishop,<span style="color: #007800;">dc</span>=org <span style="color: #660033;">-W</span> <span style="color: #660033;">-f</span> frontend.danbishop.org.ldif</pre></div></div>

<h2>Access Control</h2>
<p>Restricting access to sensitive data such as user passwords in the directory is important. The following section describes the configuration of LDAP&#8217;s Access Control Lists (ACLs).</p>
<p>Authentication requires access to password field, which will not be accessible by default. Also during password change, shadowLastChange needs to be accessible too. We change these settings using an LDIF again (acls.ldif):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">dn: olcDatabase={1}hdb,cn=config
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by dn=&quot;uid=admin,dc=danbishop,dc=org&quot; write by anonymous auth by self write by * none
olcAccess: {1}to dn.subtree=&quot;&quot; by * read
olcAccess: {2}to * by dn=&quot;uid=admin,dc=danbishop,dc=org&quot; write by * read</pre></div></div>

<p>We apply these changes with 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;">sudo</span> ldapmodify <span style="color: #660033;">-Y</span> EXTERNAL <span style="color: #660033;">-H</span> ldapi:<span style="color: #000000; font-weight: bold;">///</span> <span style="color: #660033;">-f</span> acls.ldif</pre></div></div>

<h2>References</h2>
<p><a href="http://www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-lucid-part2" onclick="pageTracker._trackPageview('/outgoing/www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-lucid-part2?referer=');">http://www.opinsys.fi/en/setting-up-openldap-on-ubuntu-10-04-lucid-part2</a></p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=301&amp;md5=541fb267714246256f04cfd172081913" 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/01/ubuntu-10-10-sbs-small-business-server-setup-part-3-openldap/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=301&amp;md5=541fb267714246256f04cfd172081913" type="text/html" />
	</item>
	</channel>
</rss>

