<?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; Uncategorized</title>
	<atom:link href="http://www.danbishop.org/category/uncategorized/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>Using hostapd to add wireless access point capabilities to an Ubuntu server.</title>
		<link>http://www.danbishop.org/2011/12/11/using-hostapd-to-add-wireless-access-point-capabilities-to-an-ubuntu-server/</link>
		<comments>http://www.danbishop.org/2011/12/11/using-hostapd-to-add-wireless-access-point-capabilities-to-an-ubuntu-server/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 21:37:55 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=627</guid>
		<description><![CDATA[The first thing to do is find out whether your hardware is capable of running in master mode. The easiest way to check this is like so: sudo apt-get install iw iw list Look through the output to find the Supported Interface Modes section: ... Supported interface modes: * IBSS * managed * AP * [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/12/11/using-hostapd-to-add-wireless-access-point-capabilities-to-an-ubuntu-server/" size="small" count="true"></div></div><p>The first thing to do is find out whether your hardware is capable of running in master mode. The easiest way to check this is 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;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> iw
iw list</pre></div></div>

<p>Look through the output to find the Supported Interface Modes section:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">...
Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * monitor
         * mesh point
...</pre></div></div>

<p>If, as in the example above, AP mode is listed, then congratulations you have everything you need! If not, all is not lost. Check out <a href="https://help.ubuntu.com/community/WifiDocs/MasterMode" onclick="pageTracker._trackPageview('/outgoing/help.ubuntu.com/community/WifiDocs/MasterMode?referer=');">this guide</a> to see how to test older hardware for master mode.</p>
<h2>HostAPD</h2>
<p>We&#8217;re going to use the hostapd service to manage our access point, the first thing to do is install, then configure 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> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> hostapd
<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>hostapd</pre></div></div>

<p>This will install hostapd and present you with the default service configuration. We need to modify this file to start hostapd at boot and tell it where we&#8217;ll store the config file. Do this by editing the DAEMON_CONF line like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DAEMON_CONF=&quot;/etc/hostapd/hostapd.conf&quot;</pre></div></div>

<p>Now we need to create a config file at the location above:</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>hostapd<span style="color: #000000; font-weight: bold;">/</span>hostapd.conf</pre></div></div>

<p>Paste the following into it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ctrl_interface=/var/run/hostapd
###############################
# Basic Config
###############################
macaddr_acl=0
auth_algs=1
# Most modern wireless drivers in the kernel need driver=nl80211
driver=nl80211
##########################
# Local configuration...
##########################
interface=wlan0
bridge=br0
hw_mode=g
channel=1
ssid=danlan
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=DONOTFORGETTOCHANGEME
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP</pre></div></div>

<p>Most of the options above are fairly self-explantory, however, there are a few things to note. Firstly, &#8220;hw_mode=g&#8221; should be set as &#8220;g&#8221; even if you want an 802.11n access point. Furthermore, you need to set a WPA passphrase where indicated.</p>
<h2>Bridging the Connections</h2>
<p>Your AP is now configured and clients will be able to connect, however, they will not be assigned an IP and they will not be able to access the network on eth0. That&#8217;s where bridging comes in. This example assumes that your server has an eth0 connection to the network and wlan0 which is being used as the wireless AP.</p>
<p>First we need to install the bridge utilities:</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> bridge-utils</pre></div></div>

<p>Edit your /etc/network/interfaces file 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
&nbsp;
auto br0
iface br0 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
        bridge-ports eth0 wlan0</pre></div></div>

<p>Note that the new br0 interface effectively replaces your existing eth0 interface. If you&#8217;ve followed the Ubuntu SBS guide to configure DHCP then you&#8217;re done! Your new AP should be up and running after a simple reboot. If not, follow the DHCP Server section of the SBS guide on this site.</p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=627&amp;md5=27c769dba2a1e7cc1f91410c2fa14ec0" 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/12/11/using-hostapd-to-add-wireless-access-point-capabilities-to-an-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=627&amp;md5=27c769dba2a1e7cc1f91410c2fa14ec0" type="text/html" />
	</item>
		<item>
		<title>How to batch convert PDFs to Jpgs</title>
		<link>http://www.danbishop.org/2011/11/28/how-to-batch-convert-pdfs-to-jpgs/</link>
		<comments>http://www.danbishop.org/2011/11/28/how-to-batch-convert-pdfs-to-jpgs/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 11:30:39 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=603</guid>
		<description><![CDATA[This is mainly for my own future reference, but might be useful to others. First things first, I had to clean up the PDF filenames, some contained spaces, some did not. rename 'y/ /-/' * This will replace all spaces with hyphens (-). Now for the converting process: for i in `ls *.pdf`; do convert [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/11/28/how-to-batch-convert-pdfs-to-jpgs/" size="small" count="true"></div></div><p>This is mainly for my own future reference, but might be useful to others. First things first, I had to clean up the PDF filenames, some contained spaces, some did not.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rename <span style="color: #ff0000;">'y/ /-/'</span> <span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>This will replace all spaces with hyphens (-).</p>
<p>Now for the converting process:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.pdf<span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">do</span> convert <span style="color: #660033;">-density</span> <span style="color: #000000;">125</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$i</span>&quot;</span>.jpg; <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>This will convert all .pdf files in the current directory. It requires imagemagik to be installed (on Ubuntu you will be given instructions on how to do this if it&#8217;s not already installed when you run the command).</p>
<p>The option &#8220;-density 125&#8243; can be adjusted to produce different sized Jpg files, the higher the number, the higher the resolution and consequently the file size.</p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=603&amp;md5=ca987bbf055d8157aa7274ca9991bf07" 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/11/28/how-to-batch-convert-pdfs-to-jpgs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=603&amp;md5=ca987bbf055d8157aa7274ca9991bf07" type="text/html" />
	</item>
		<item>
		<title>How to Install Ubuntu from USB on Macbook Air 4,2 (2011)</title>
		<link>http://www.danbishop.org/2011/09/09/how-to-install-ubuntu-from-usb-on-macbook-air-42-2011/</link>
		<comments>http://www.danbishop.org/2011/09/09/how-to-install-ubuntu-from-usb-on-macbook-air-42-2011/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 08:12:36 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=569</guid>
		<description><![CDATA[Create Ubuntu USB Stick First download an Ubuntu iso from www.ubuntu.com/download Be sure to get the 64bit+mac desktop version. The first step is to convert the iso to a dmg using the terminal: hdiutil convert -format UDRW -o ~/Downloads/ubuntu.dmg ~/Downloads/ubuntu-11.10-desktop-amd64+mac.iso Run the command &#8220;diskutil list&#8221; without your usb stick in, then again once the stick [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/09/09/how-to-install-ubuntu-from-usb-on-macbook-air-42-2011/" size="small" count="true"></div></div><h2>Create Ubuntu USB Stick</h2>
<p>First download an Ubuntu iso from www.ubuntu.com/download</p>
<p>Be sure to get the 64bit+mac desktop version.</p>
<p>The first step is to convert the iso to a dmg using the terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">hdiutil convert <span style="color: #660033;">-format</span> UDRW <span style="color: #660033;">-o</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>ubuntu.dmg ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>ubuntu-<span style="color: #000000;">11.10</span>-desktop-amd64+mac.iso</pre></div></div>

<p>Run the command &#8220;diskutil list&#8221; without your usb stick in, then again once the stick has been inserted. The output from the second command should look something like:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">dan-macbookair:~ dan$ diskutil  list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            120.5 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *16.0 GB    disk1
   1:             Windows_FAT_32                         16.0 GB    disk1s1</pre></div></div>

<p>As you can see, disk1 has appeared since the insertion of the USB stick. It is very important you work out which disk your USB stick is in this way, else the next step will cause you to wipe out data on your Macbook Air&#8217;s SSD!</p>
<p>Now run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">diskutil unmountDisk <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk1</pre></div></div>

<p>Substituting disk1 for your USB stick&#8217;s disk number.</p>
<p>Next we&#8217;re going to write the image to the stick 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;">dd</span> <span style="color: #007800;">if</span>=~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>ubuntu.dmg <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rdisk1 <span style="color: #007800;">bs</span>=1m</pre></div></div>

<p>Note that this time we&#8217;ve added an r to the front of disk1, this is not essential, but will speed up the process.</p>
<p>Finally, once the above command has executed, run &#8220;diskutil eject /dev/disk1&#8243; again replacing disk1 with your own stick&#8217;s reference.</p>
<p>Your USB stick has been created, restart your Macbook Air holding the alt key and choose to boot from the stick.</p>
<h2>Installation</h2>
<p>As soon as you see the purple screen with the white icon at the bottom, hit any key to get the USB stick&#8217;s boot menu. Select your language then press F6 and select the nomodeset option. Press ESC to return to the main menu and select &#8220;Try Ubuntu without any change to your computer&#8221;.</p>
<p>Proceed with the installation as normal, once finished, reboot the machine and hold down alt. Ubuntu will show up as &#8220;Windows&#8221;, select this option.</p>
<p>After a short pause you will see Grub and a list of boot options, press &#8220;e&#8221; to edit the default boot options. You will be presented with several strings of text, the penultimate line begins &#8220;Linux&#8230;&#8221; scroll along this line and add &#8220;nomodeset&#8221; directly before &#8220;quiet splash&#8221; so that it now reads &#8220;&#8230; nomodeset quiet splash &#8230;&#8221;.</p>
<p>Press ctrl+x to boot Ubuntu.</p>
<h2>Fixing things&#8230;<br />
<h2>
<p>First things first, install any updates that have come out since 11.10 was released:</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> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</pre></div></div>

<p>Now reboot. Yes, I know, how Windows-like&#8230; but we are about to start playing with your kernel and it&#8217;s a good idea to be using the new one you&#8217;ll have just installed through updates! Don&#8217;t forget to use the nomodeset trick from above again (don&#8217;t worry&#8230; this should be the last time!).</p>
<p>Now we&#8217;re going to run the incredible post-install-oneiric.sh script from almostsure.com:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>almostsure.com<span style="color: #000000; font-weight: bold;">/</span>mba42<span style="color: #000000; font-weight: bold;">/</span>post-install-oneiric.sh
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x post-install-oneiric.sh
.<span style="color: #000000; font-weight: bold;">/</span>post-install-oneiric.sh</pre></div></div>

 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=569&amp;md5=37d9f91b7f76c204ff892dfd65a122e2" title="Flattr" target="_blank"><img src="http://www.danbishop.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.danbishop.org/2011/09/09/how-to-install-ubuntu-from-usb-on-macbook-air-42-2011/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=569&amp;md5=37d9f91b7f76c204ff892dfd65a122e2" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 7 – Setting Up Clients</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/#comments</comments>
		<pubDate>Sun, 01 May 2011 16:58:25 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=500</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-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 Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; 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-500"></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 group, passwd and shadow!</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.home</pre></div></div>

<p>This creates a mount point at /home and configures it according to the settings specified in /etc/auto.home (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.home</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,soft,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>Finally, we want the local machine to use LDAP groups and users over local ones so that domain administrators will have admin access to every machine on the network. This is done by editing /etc/nsswtich.conf</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>nsswitch.conf</pre></div></div>

<p>By default the file looks like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc &quot;Name Service Switch&quot;' for information about this file.
&nbsp;
passwd:         compat ldap
group:          compat ldap
shadow:         compat ldap
&nbsp;
hosts:          files dns
networks:       files
&nbsp;
protocols:      db files
services:       db files
ethers:         db files
rpc:            db files
&nbsp;
netgroup:       nis</pre></div></div>

<p>We want to change passwd, group and shadow to use LDAP first:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">passwd:         ldap files
group:          ldap files
shadow:         ldap files</pre></div></div>

<p>Now restart the client machine and you&#8217;re done! <img src='http://www.danbishop.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=500&amp;md5=5e0d95c9f68e748188276032f5ac8701" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-7-%e2%80%93-setting-up-clients/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=500&amp;md5=5e0d95c9f68e748188276032f5ac8701" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 6 – Account Management</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-6-%e2%80%93-account-management/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-6-%e2%80%93-account-management/#comments</comments>
		<pubDate>Sun, 01 May 2011 16:36:33 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=498</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-6-%e2%80%93-account-management/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; Setting Up Clients</a></ol>
</ul>
<p>Now you have OpenLDAP and Kerberos up and running, it&#8217;s time to learn how to manage your users and groups.<span id="more-498"></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=Users&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=Users&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>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>

<p>You might also have noticed that /etc/adduser.conf is used to determine home directory defaults. Ubuntu allows users to view the contents of other user&#8217;s home directories by default. In some environments, particularly home environments, this is fine, but you might want to change that by editing DIR_MODE=0755 to be DIR_MODE=0700.</p>
<h2>Managing Users</h2>
<p>Now the LDAP scripts are configured we can start creating users. We&#8217;re going to use the group name &#8220;admin&#8221; for administrators as this is the default for Ubuntu and will enable us to give admin rights to users on every machine on the network without any further configuration. However, as this group already exists as a local group, we need to be very careful that we don&#8217;t lock ourselves out of the server here&#8230;</p>
<p>The first thing to do is create a password for our first admin user. As we are using Kerberos for authentication, the administrator needs a principal creating. 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> kadmin.local <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;addprinc dan&quot;</span></pre></div></div>

<p>Now we need some groups to hold our users. The first two groups we will create will be &#8220;admin&#8221; and &#8220;user&#8221;:</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 <span style="color: #000000;">10001</span></pre></div></div>

<p>Note the use of group 10001 rather than simply &#8220;admin&#8221;. This is to avoid any confusion with the local admin group on the server. In some instances, I&#8217;ve seen this cause issues. Group 10001 will be the first ldap group you created, you can see the GIDs for all groups by using the command &#8220;getent group&#8221;.</p>
<p>And finally add the user to the user 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 <span style="color: #000000;">10002</span></pre></div></div>

<p>You can now login to the server (and later client machines) as this user. The &#8220;localadmin&#8221; account on the server will no longer be able to use sudo as it doesn&#8217;t belong to the ldap &#8220;admin&#8221; group, only the local one. For subsequent users, you may create the Kerberos principal after creating the LDAP user if you prefer.</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=498&amp;md5=f050e3b86c834cb553ed832beaf0778b" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-6-%e2%80%93-account-management/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=498&amp;md5=f050e3b86c834cb553ed832beaf0778b" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 5 – NFS</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-5-%e2%80%93-nfs/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-5-%e2%80%93-nfs/#comments</comments>
		<pubDate>Sun, 01 May 2011 16:09:17 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=496</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-5-%e2%80%93-nfs/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; Setting Up Clients</a></ol>
</ul>
<p>This section will help you configure NFS; using Kerberos to secure it.<span id="more-496"></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;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> kadmin.local <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>Finally, a small change is needed to enable weak encryption (the only type currently supported by NFS in Ubuntu) in Kerberos. This is done by editing /etc/krb5.conf and adding the following to the [libdefaults] section:</p>

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

 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=496&amp;md5=1a0480a043cbf7d1d13db57203369f7c" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-5-%e2%80%93-nfs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=496&amp;md5=1a0480a043cbf7d1d13db57203369f7c" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 4 – Kerberos</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-4-%e2%80%93-kerberos/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-4-%e2%80%93-kerberos/#comments</comments>
		<pubDate>Sun, 01 May 2011 14:43:07 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=494</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-4-%e2%80%93-kerberos/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; Setting Up Clients</a></ol>
</ul>
<p>It&#8217;s time to install and configure Kerberos.<span id="more-494"></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>There will be a slight delay whilst the server gathers enough random data to continue, then 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>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 and LDAP are selected as authentication methods to allow users to login/ssh into the server. </p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=494&amp;md5=13f25c9947783b985e62ea315bf9ed93" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-4-%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=494&amp;md5=13f25c9947783b985e62ea315bf9ed93" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 3 &#8211; OpenLDAP</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-3-openldap/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-3-openldap/#comments</comments>
		<pubDate>Sun, 01 May 2011 13:51:43 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=492</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-3-openldap/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; 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 groups and other information. 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 authentication, we&#8217;ll be using Kerberos for this purpose.<span id="more-492"></span></p>
<p>The first step is to install OpenLDAP along with some utilities for administering 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> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> slapd ldap-utils</pre></div></div>

<p>You will be prompted for an LDAP admin password, once you have set this, much of the manual configuration that had to be done in previous release is handled automatically in 11.04. Ubuntu will configure LDAP using the domain information we supplied in previous steps in this guide. If you do wish to make changes to this though, you can run &#8220;sudo dpkg-reconfigure slapd&#8221;. All that remains to be done is creating a place in the OpenLDAP directory to store our users and our groups.</p>
<p>This is done by creating a frontend.danbishop.org.ldif file like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">dn: ou=Users,dc=danbishop,dc=org
objectClass: organizationalUnit
ou: Users
&nbsp;
dn: ou=Groups,dc=danbishop,dc=org
objectClass: organizationalUnit
ou: Groups</pre></div></div>

<p><strong>Please note:</strong> it is important that you have a new line between &#8220;ou:Users&#8221; and &#8220;dn: ou=Groups,dc=danbishop,dc=org&#8221; if you&#8217;re copying and pasting the above, it will have a space at the beginning of the blank line, you must remove this!</p>
<p>Now we add the LDIF in the following way, entering your root LDAP password when prompted (the one you set during slapd installation):</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>LDAP Authentication on the Server</h2>
<p>LDAP doesn&#8217;t actually contain any users or groups yet, but now would be a good time to configure the server to check ldap for login information, so that after we&#8217;ve setup Kerberos and created our first users we&#8217;re ready to go! 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 to confirm your LDAP settings and which services you&#8217;d like to enable LDAP for, you should select &#8220;group&#8221;, &#8220;passwd&#8221; and &#8220;shadow&#8221;. The packages will then configure /etc/nsswitch.conf, /etc/pam.d/common-auth and /etc/nslcd.conf to work automatically.</p>
<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=492&amp;md5=2efe2971e56ce2f5b7a1a06f29f64356" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-3-openldap/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=492&amp;md5=2efe2971e56ce2f5b7a1a06f29f64356" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 2 &#8211; NTP</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-2-ntp/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-2-ntp/#comments</comments>
		<pubDate>Sun, 01 May 2011 13:37:04 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=487</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-2-ntp/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; Setting Up Clients</a></ol>
</ul>
<p>Your server will automatically request the time from the Ubuntu NTP servers on every boot&#8230; but hopefully you&#8217;re not going to reboot it very often. It is useful for the server time to be correct when debugging and it is ESSENTIAL for the server and all the clients on the network to have the same time (±5mins by default) for Kerberos to work.<span id="more-487"></span></p>
<p>Fortunately, this is a very easy thing to configure on Ubuntu. Simply install ntpd 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> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> ntp</pre></div></div>

<p>As of Ubuntu 11.04, a default pool of NTP servers will be used.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org</pre></div></div>

<p>However you can change this by editing /etc/ntp.conf</p>
<h2>References</h2>
<p><a href="https://help.ubuntu.com/10.04/serverguide/C/NTP.html" onclick="pageTracker._trackPageview('/outgoing/help.ubuntu.com/10.04/serverguide/C/NTP.html?referer=');">https://help.ubuntu.com/10.04/serverguide/C/NTP.html</a></p>
 <p><a href="http://www.danbishop.org/?flattrss_redirect&amp;id=487&amp;md5=14c4bee309abe0f7dce08efa82ca7a5c" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-2-ntp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=487&amp;md5=14c4bee309abe0f7dce08efa82ca7a5c" type="text/html" />
	</item>
		<item>
		<title>Ubuntu 11.04 SBS (Small Business Server) Setup: Part 1 – DHCP and DNS</title>
		<link>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/</link>
		<comments>http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/#comments</comments>
		<pubDate>Sun, 01 May 2011 13:27:29 +0000</pubDate>
		<dc:creator>Dan Bishop</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.danbishop.org/?p=483</guid>
		<description><![CDATA[This is part of a guide to setting up Ubuntu Server Edition 11.04 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. Part [...]]]></description>
			<content:encoded><![CDATA[<div class="alignleft"><div class="g-plusone" data-href="http://www.danbishop.org/2011/05/01/ubuntu-11-04-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/" size="small" count="true"></div></div><p>This is part of a guide to setting up Ubuntu Server Edition 11.04 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>
<ul>
<ol><a href="http://www.danbishop.org/?p=483">Part 1 &#8211; DHCP and DNS</ol>
<ol><a href="http://www.danbishop.org/?p=487">Part 2 &#8211; NTP</a></ol>
<ol><a href="http://www.danbishop.org/?p=492">Part 3 &#8211; OpenLDAP</a></ol>
<ol><a href="http://www.danbishop.org/?p=494">Part 4 &#8211; Kerberos</a></ol>
<ol><a href="http://www.danbishop.org/?p=496">Part 5 &#8211; NFS</a></ol>
<ol><a href="http://www.danbishop.org/?p=498">Part 6 &#8211; Account Management</a></ol>
<ol><a href="http://www.danbishop.org/?p=500">Part 7 &#8211; Setting Up Clients</a></ol>
</ul>
<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-483"></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=483&amp;md5=9b027b251ab7755dd4365b86819152cf" 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/01/ubuntu-11-04-sbs-small-business-server-setup-part-1-%e2%80%93-dhcp-and-dns/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<atom:link rel="payment" href="http://www.danbishop.org/?flattrss_redirect&amp;id=483&amp;md5=9b027b251ab7755dd4365b86819152cf" type="text/html" />
	</item>
	</channel>
</rss>

