<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Lani's Weblog</title>
	<atom:link href="http://lani78.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lani78.wordpress.com</link>
	<description>Computer related mumbo jumbo</description>
	<lastBuildDate>Fri, 25 Nov 2011 15:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lani78.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Lani's Weblog</title>
		<link>http://lani78.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lani78.wordpress.com/osd.xml" title="Lani&#039;s Weblog" />
	<atom:link rel='hub' href='http://lani78.wordpress.com/?pushpress=hub'/>
		<item>
		<title>GNOME Auto login in Ubuntu 9.10 Karmic Koala Alpha 3</title>
		<link>http://lani78.wordpress.com/2009/07/30/gnome-auto-login-in-ubuntu-9-10-karmic-koala-alpha-3/</link>
		<comments>http://lani78.wordpress.com/2009/07/30/gnome-auto-login-in-ubuntu-9-10-karmic-koala-alpha-3/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 21:58:54 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[GDM]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Karmic Koala]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=124</guid>
		<description><![CDATA[Ubuntu 9.10 alpha 3 comes with the latest GDM (The GNOME Display Manager, which is the default login manager shipped with Ubuntu). Unfortunately the latest version, 2.27.4, is an unstable version that still is heavily under development and still lacks a graphical configuration dialog. So if you, like me, decided that you actually wanted to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=124&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ubuntu.com/testing/karmic/alpha3">Ubuntu 9.10 alpha 3</a> comes with the latest <a href="http://projects.gnome.org/gdm/">GDM</a> (The <a href="http://www.gnome.org/">GNOME</a> Display Manager, which is the default login manager shipped with Ubuntu). Unfortunately the latest version, <a href="http://live.gnome.org/TwoPointTwentyseven/">2.27.4</a>, is an unstable version that still is heavily under development and still lacks a graphical configuration dialog.</p>
<p>So if you, like me, decided that you actually wanted to login automatically in GNOME instead of the manual login that you choose in the installation process, or vice versa. Well then it&#8217;s back to the configuration files. The default configuration values used by GDM is located in the <a href="http://www.w3.org/XML/">XML</a> file named &#8216;/etc/gdm/gdm.schema&#8217;. The documentation does however state that any changes to the default values should be made to the &#8216;/ect/gdm/custom.conf&#8217; file, which is in <a href="http://en.wikipedia.org/wiki/INI_file">keyfile</a> format.</p>
<h3>Configure GDM to auto login a specific user</h3>
<ol>
<li>Open the &#8216;Run Application&#8217; dialog by pressing:
<pre> Alt+F2</pre>
</li>
<li>Open/create the custom.conf file with gedit:
<pre>gksu gedit /etc/gdm/custom.conf</pre>
</li>
<li>Enter the configuration values that you want to override:
<pre>[daemon]
AutomaticLoginEnable=true
AutomaticLogin=lani</pre>
</li>
<li>Reboot your system, and viola &#8211; you&#8217;re automatically logged in to GNOME! <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<h4>Configuration explanation</h4>
<p>Note that the [deamon] directive must be included in the file, it tells GDM in what section we want to override the keys. The AutomaticLoginEnable key  can be set to either true or false, to disable or enable the automatic login into GNOME. And finally the AutomaticLogin key should be set to the username of the user that should be loged into GNOME automatically, in the example above my username is lani.</p>
<h3>References</h3>
<p><a href="http://library.gnome.org/admin/gdm/2.27/">GNOME Display Manager Reference Manual</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=124&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2009/07/30/gnome-auto-login-in-ubuntu-9-10-karmic-koala-alpha-3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Fix Marvel Yukon sky2 driver in Ubuntu Jaunty</title>
		<link>http://lani78.wordpress.com/2009/07/08/fix-marvel-yukon-sky2-driver-in-ubuntu-jaunty/</link>
		<comments>http://lani78.wordpress.com/2009/07/08/fix-marvel-yukon-sky2-driver-in-ubuntu-jaunty/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 20:48:15 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Jaunty Jackalope]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=115</guid>
		<description><![CDATA[EDIT: THIS DID NOT WORK FOR ME! I thought that it worked at first, I did several tests, downloading in 100 mbit from the internet using 10 different connections and transfering files from my server in 275 mbit. But today the network connection has dropped twice for me. If this works for you, then I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=115&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;"><strong>EDIT: THIS DID <span style="text-decoration:underline;">NOT</span></strong></span> <span style="color:#ff0000;"><strong>WORK FOR ME!</strong></span></p>
<p><span style="color:#ff0000;"><strong>I thought that it worked at first, I did several tests, downloading in 100 mbit from the internet using 10 different connections and transfering files from my server in 275 mbit. But today the network connection has dropped twice for me. If this works for you, then I&#8217;m happy for you. If you have another solution, please leave a comment. Thank you.<br />
</strong></span></p>
<p>I have an on-board Marvell Yukon 88E8053 PCI-E gigabit ethernet controller (rev 15), which kept dropping the network connection during heavy load using the sky2 driver. I tried to compile the sk98lin driver instead, but I couldn&#8217;t get it to compile successfully on my system. That&#8217;s when I found out that <a title="MSI" href="http://en.wikipedia.org/wiki/Message_Signaled_Interrupts" target="_blank">MSI</a> might not be <a title="correctly implemented" href="http://lkml.indiana.edu/hypermail/linux/kernel/0602.3/1038.html" target="_blank">correctly implemented</a>, fortunately the MSI feature can be easily turned off in the latest sky2 driver using the disable_msi option.</p>
<h2>Permanently disable MSI</h2>
<p>1. Open the /etc/modules file for editing:</p>
<pre>sudo gedit /etc/modules</pre>
<p>2. Add the following new line:</p>
<pre>sky2 disable_msi=1</pre>
<p>3. Restart your computer. And viola, hopefully your NIC will now have stopped dropping your connection all the time.</p>
<h2>Temporarily disable MSI</h2>
<p>If you would like to test if the diable_msi option works for you before disabling it &#8220;permanently&#8221;, or to avoid a restart. Then you can unload the sky2 driver manually and load it with the disable_msi=1 option.</p>
<pre>sudo rmmod sky2
sudo modprobe sky2 disable_msi=1</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=115&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2009/07/08/fix-marvel-yukon-sky2-driver-in-ubuntu-jaunty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Make your DHCP server dynamically update your DNS records on Ubuntu Hardy Heron</title>
		<link>http://lani78.wordpress.com/2008/08/12/dhcp-server-update-dns-records/</link>
		<comments>http://lani78.wordpress.com/2008/08/12/dhcp-server-update-dns-records/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 21:58:51 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=71</guid>
		<description><![CDATA[Information The steps in this post shows how to configure the DHCP server to automatically update the DNS records when giving out a new lease to a client computer. All on the Ubuntu Hardy Heron server. Before continuing These steps assumes that you already have a working copy of dhcp3-server and bind9 installed. If you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=71&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Information</strong><br />
The steps in this post shows how to configure the DHCP server to automatically update the DNS records when giving out a new lease to a client computer. All on the Ubuntu Hardy Heron server.</p>
<p><strong>Before continuing</strong><br />
These steps assumes that you already have a working copy of dhcp3-server and bind9 installed. If you don&#8217;t have that I suggest that you first read my two other posts on how to install them:</p>
<p><a href="http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/">Setting up a DNS for the local network on the Ubuntu Hardy Heron server</a><br />
<a href="http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/">Setting up a DHCP server on Ubuntu Hardy Heron</a></p>
<p><strong>Step by step instructions</strong></p>
<p><em>1. Move the files to a directory that bind can write to</em></p>
<p>Apparently the Ubuntu server is installed with an <a href="http://en.opensuse.org/Apparmor">AppArmor</a> profile that prevents bind to write to the /etc/bind directory. The default profile suggests that these files should be put in /var/lib/bind. If you have followed the steps in my previous post you might have your zone database files in /etc/bind/zones. We will start by copying the files so we have a backup remaining if anything goes wrong:</p>
<p>1.1 Copy the zone database files:</p>
<pre>sudo cp /etc/bind/zones/* /var/lib/bind/</pre>
<p>1.2 Change the owner and group of the files to bind, so that bind will have file permissions that allows it to write to the files:</p>
<pre>sudo chown bind:bind /var/lib/bind/*</pre>
<p><em>2. Create a secret shared between the DHCP server and the DNS</em></p>
<p>We don&#8217;t wont anybody to be able to update our DNS, so we need to create a secret, a key, that the DCHP server must know in order to be able to update the DNS.</p>
<p>2.1 Generate a new key:</p>
<pre>sudo dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER</pre>
<p>2.2 Show the generated key:</p>
<pre>sudo cat Kdhcp_updater.*.private|grep Key</pre>
<p>2.3 Now copy the key to the clipboard so that you can paste it into the configuration file later on. </p>
<p><em>3 Configure the DNS</em></p>
<p>We now need to add the key to the bind configuration and tell it what zones that we want it to allow updates on. I&#8217;ve included the whole contents of my file here and marked the changes that I&#8217;ve made in bold.</p>
<p>3.1 Edit /etc/bind/named.conf.local:</p>
<pre>sudo nano /etc/bind/named.conf.local</pre>
<p>3.2 Changes are marked with bold:</p>
<pre># The secret key used for DHCP updates.
<strong>key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;

    # Important: Replace this key with your generated key.
    # Also note that the key should be surrounded by quotes.
    secret "asdasddsaasd/dsa==";
};</strong>

zone "home.lan" {
    type master;

    # Change the path of the database file to the writable copy in /var/lib/bind
    file "<strong>/var/lib/bind/</strong>home.lan.db";

    # Tell this zone that we will allow it to be updated from anyone
    # that knows the secret specified in the DHCP_UPDATER key.
    <strong>allow-update { key DHCP_UPDATER; };</strong>
};

zone "10.10.10.in-addr.arpa"  {
    type master;

    # Change the path of the database file to the writable copy in /var/lib/bind
    file "<strong>/var/lib/bind/</strong>rev.10.10.10.in-addr.arpa";

    # Tell this zone that we will allow it to be updated from anyone
    # that knows the secret specified in the DHCP_UPDATER key.
    <strong>allow-update { key DHCP_UPDATER; };</strong>
};</pre>
<p><em>4 Configure the DHCP server to send updates to the DNS</em></p>
<p>4.1 Edit dhcpd.conf:</p>
<pre>sudo nano  /etc/dhcp3/dhcpd.conf</pre>
<p>4.2 Changes are marked with bold:</p>
<pre>#
# Make sure to change the ddns update style to interim:
ddns-update-style <strong>interim</strong>;
<strong>ignore client-updates;</strong>      # Overwrite client configured FQHNs
<strong>ddns-domainname "home.lan.";</strong>
<strong>ddns-rev-domainname "in-addr.arpa.";</strong>

# option definitions common to all supported networks...
option domain-name "home.lan";
option domain-name-servers ubuntu.home.lan;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

<strong>key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;

    # Important: Replace this key with your generated key.
    # Also note that the key should be surrounded by quotes.
    secret "asdasddsaasd/dsa==";
};</strong>

<strong>zone home.lan. {
  primary 127.0.0.1;
  key DHCP_UPDATER;
}

zone 10.10.10.in-addr.arpa. {
  primary 127.0.0.1;
  key DHCP_UPDATER;
}</strong>

# This is a very basic subnet declaration.
subnet 10.10.10.0 netmask 255.255.255.0 {
  range 10.10.10.100 10.10.10.200;
  option routers router.home.lan;
}</pre>
<p><em>5 Tighten the permissions on the configuration files</em></p>
<p>The configuration files now contains our secret key. We should not let just anyone read our secret key, so lets remove the general read rights from them:</p>
<pre>sudo chmod o-r /etc/bind/named.conf.local
sudo chmod o-r /etc/dhcp3/dhcpd.conf
</pre>
<p>We should now have a fully working dynamic dns system for our local network, lets hold our thumbs and restart the services.</p>
<p><em>6 Restart the services to reload the configuration.</em></p>
<pre>sudo /etc/init.d/bind9 restart
sudo /etc/init.d/dhcp3-server restart</pre>
<p><em>7 Testing the setup</em></p>
<p>7.1 If you have an Ubuntu <strong>client</strong> that uses DHCP you can restart its network to make the DHCP-<strong>client</strong> request a new ip-address from the server:</p>
<pre>sudo /etc/init.d/networking restart</pre>
<p>7.2 You should now be able to lookup your client computer in your DNS:</p>
<pre>host lani-desktop</pre>
<p>Result:<br />
lani-desktop.home.lan has address 10.10.10.100</p>
<p>7.3 And the reverse should now also work for your client computer address:</p>
<pre>host 10.10.10.100</pre>
<p>Result:<br />
100.10.10.10.in-addr.arpa domain name pointer lani-desktop.home.lan.</p>
<p><em>8 Cleanup</em></p>
<p>8.1 Remove the generated key files:</p>
<pre> sudo rm Kdhcp_updater.*</pre>
<p>8.2 Remove the old zone db files:</p>
<pre>sudo rm -R /etc/bind/zones</pre>
<p>Done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Some &#8220;important&#8221; pointers</strong></p>
<p><em>Database files being rewritten by bind</em><br />
The dns database files are now being rewritten by the bind service. Some people have mentioned that they think that bind messes up these files so that they are impossible to maintain. I don&#8217;t think that they are that bad and personally I don&#8217;t have any problem editing them after that bind has rewritten them. I&#8217;m not sure how often that bind rewrites these files, but at least it seems to always happen when you stop the bind service. What I think is more important is to always <strong>stop the bind service before making any changes to the database files</strong>, otherwise they might be overwritten by bind.</p>
<p>Examples of how to stop and start the bind service:</p>
<pre>sudo /etc/init.d/bind9 stop
sudo /etc/init.d/bind9 start
</pre>
<p>The only way that I can think of to avoid this problem is to split your domains into two sub domains, for example dyn.home.lan. and static.home.lan. You could then have the DCHP server to only update the dyn.home.lan domain. But I didn&#8217;t want this and I&#8217;m not going to update these files that often that it matters for me. Please let me know if you know of a better solution. </p>
<p><em>Key generation</em><br />
When using the dnssec-keygen to generate the secret key I passed it the parameter &#8220;-r /dev/urandom&#8221;. I&#8217;ve seen some pointers about that this will generate a less secure key. But for me the dnssec-keygen would just halt without that parameter. One other suggestion that I&#8217;ve seen it that you should switch to another terminal window on the server and run some commands that make some work on the server, to make it fill up the default /dev/random. I think that I would have done this if I would set this up in a corporate environment. But for my own home network I really think that the /dev/urandom will be sufficient. </p>
<p><em>Troubleshooting</em><br />
There must be many more ways to troubleshoot any problems. But I managed to get it working by checking the system log for clues when a service didn&#8217;t start or when the DHCP server didn&#8217;t update the DNS records:</p>
<pre>tail /var/log/syslog</pre>
<p><em>That&#8217;s it!</em><br />
I&#8217;ve really tried to make these steps as accurate as possible, following my own steps to get this to work. Please let me know if you think that I&#8217;ve missed something. Thank you.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/71/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/71/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=71&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/12/dhcp-server-update-dns-records/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up a DHCP server on Ubuntu Hardy Heron</title>
		<link>http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/</link>
		<comments>http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 18:11:22 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=63</guid>
		<description><![CDATA[This is my really short installation log of how I installed and configured a DHCP server on Ubuntu Hardy Heron. 1: Make sure that the latest version is installed: sudo apt-get install dhcp3-server Note: Don&#8217;t be alarmed if the startup fails; that&#8217;s because you haven&#8217;t configured it yet. 2.1: Edit the DHCP server configuration: sudo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=63&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is my really short installation log of how I installed and configured a DHCP server on Ubuntu Hardy Heron.</p>
<p>1: Make sure that the latest version is installed:</p>
<pre>sudo apt-get install dhcp3-server</pre>
<p><em>Note: Don&#8217;t be alarmed if the startup fails; that&#8217;s because you haven&#8217;t configured it yet.</em></p>
<p>2.1: Edit the DHCP server configuration: </p>
<pre>sudo nano /etc/dhcp3/dhcpd.conf </pre>
<p>2.2: The contents of my configuration file, for me the comments already in the file was what I needed to make the necessary changes: </p>
<pre># The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "home.lan";
option domain-name-servers ubuntu.home.lan;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# This is a very basic subnet declaration.
subnet 10.10.10.0 netmask 255.255.255.0 {
  range 10.10.10.100 10.10.10.200;
  option routers router.home.lan;
}
</pre>
<p>3: Start the DHCP server (it should now start without problems):</p>
<pre>sudo /etc/init.d/dhcp3-server start</pre>
<p>Done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=63&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/10/setting-up-a-dhcp-server-on-ubuntu-hardy-heron/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting up a DNS for the local network on the Ubuntu Hardy Heron server</title>
		<link>http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/</link>
		<comments>http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 16:20:15 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=51</guid>
		<description><![CDATA[Condensed version This is my really condensed step by step procedure that I took to setup my local dns for our local network at home. It really isn&#8217;t more than just a shorter version of the great guides posted by Sam Davis: BIND Caching Name Server Setup BIND Master Server Setup I really recommend that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=51&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Condensed version</strong></p>
<p>This is my really condensed step by step procedure that I took to setup my local dns for our local network at home. It really isn&#8217;t more than just a shorter version of the great guides posted by <a href="http://www.zaphu.com/author/sam/" target="_blank">Sam Davis:</a></p>
<p><a href="http://www.zaphu.com/2007/09/10/ubuntu-dns-server-guide-bind-caching-name-server-setup/" target="_blank">BIND Caching Name Server Setup</a><br />
<a href="http://www.zaphu.com/2007/09/14/ubuntu-dns-server-guide-bind-master-server-setup/">BIND Master Server Setup</a></p>
<p>I really recommend that you read his two post to get some more information, then you can check my pointers and maybe my configurations posted below if you want yet another example to look at.</p>
<p><strong>Step by step instructions</strong></p>
<p>1: Make sure that the latest version of bind9 is installed (that&#8217;s the dns-server software):<br />
<code>sudo apt-get install bind9</code></p>
<p>2.1: Configure the DNS to cache requests:<br />
<code>sudo nano /etc/bind/named.conf.options</code></p>
<p>2.2: Uncomment or add the <em>forwarders</em> section and replace the x:es with the ip-address to the primary and secondary dns of your isp:</p>
<pre>forwarders {
        x.x.x.x;
        x.x.x.x;
};</pre>
<p>3.1: Make the server use its own DNS for lookups:<br />
<code>sudo nano /etc/resolv.conf</code></p>
<p>3.2: Change or add the nameserver directive to point to the local machine:<br />
<code>nameserver 127.0.0.1</code></p>
<p>3.3: You can also add a search directive, to that you don&#8217;t have to type the whole fully qualified domain name every time, just the computer name instead:<br />
<code>search home.lan</code></p>
<p><em>Note: This must also be done for other Ubuntu clients that use a static IP. But then it should point to the IP of the DNS server. If you have a DHCP server you should specify your DNS IP in its settings, as well as the search domain.</em></p>
<p>4.1: Define the zones for the local domain:<br />
<code>sudo nano /etc/bind/named.conf.local</code></p>
<p>4.2: Add a zone for the local domain:</p>
<pre>zone "home.lan" IN {
    type master;
    file "/etc/bind/zones/home.lan.db";
};</pre>
<p>4.3: Also add a zone for reverse dns lookups for the local network:</p>
<pre>zone "10.10.10.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/rev.10.10.10.in-addr.arpa";
};</pre>
<p><em>Note: Make sure that it&#8217;s literal quotes that is used, so that they not are converted if you copy and past them to the terminal. You get literal quotes on a Swedish keyboard by pressing &#8220;Shif+2&#8243;, on an English keybord it might be &#8220;Shif+,&#8221; ? </em></p>
<p>5: Create the zones directory:<br />
<code>sudo mkdir /etc/bind/zones</code></p>
<p>6.1: Configure the local domain:<br />
<code>sudo nano /etc/bind/zones/home.lan.db</code></p>
<p>6.2: My settings, change to your match your host names and ip-addresses:</p>
<pre>; Use semicolons to add comments.
; Do NOT add empty lines.
; Host-to-IP Address DNS Pointers for home.lan
; Note: The extra “.” at the end of addresses are important.
; The following parameters set when DNS records will expire, etc.
; Importantly, the serial number must always be iterated upward to prevent
; undesirable consequences. A good format to use is YYYYMMDDII where
; the II index is in case you make more that one change in the same day.
home.lan. IN SOA ubuntu.home.lan. hostmaster.home.lan. (
    2008080901 ; serial
    8H ; refresh
    4H ; retry
    4W ; expire
    1D ; minimum
)
; NS indicates that ubuntu is the name server on home.lan
; MX indicates that ubuntu is (also) the mail server on home.lan
home.lan. IN NS ubuntu.home.lan.
home.lan. IN MX 10 ubuntu.home.lan.
; Set the address for localhost.home.lan
localhost    IN A 127.0.0.1
; Set the hostnames in alphabetical order
print-srv    IN A 10.10.10.9
router       IN A 10.10.10.10
server       IN A 10.10.10.5
ubuntu       IN A 10.10.10.1
xbox         IN A 10.10.10.2</pre>
<p>7.1: Create and edit the reverse lookup configuration file:<br />
<code>sudo nano /etc/bind/zones/rev.10.10.10.in-addr.arpa</code></p>
<p>7.2: My settings, reversed of the above:</p>
<pre>; IP Address-to-Host DNS Pointers for the 10.10.10.0 subnet
@ IN SOA ubuntu.home.lan. hostmaster.home.lan. (
    2008080901 ; serial
    8H ; refresh
    4H ; retry
    4W ; expire
    1D ; minimum
)
; define the authoritative name server
           IN NS ubuntu.home.lan.
; our hosts, in numeric order
1         IN PTR ubuntu.home.lan.
2         IN PTR xbox.home.lan.
5         IN PTR server.home.lan.
9         IN PTR print-srv.home.lan.
10        IN PTR router.home.lan.</pre>
<p>8: Restart bind to use the new settings:<br />
<code>sudo /etc/init.d/bind9 restart</code></p>
<p>9: Test that the dns lookups works with the local server:<br />
<code>host ping.sunet.se</code></p>
<p>The response should be:<br />
ping.sunet.se has address 192.36.125.18<br />
ping.sunet.se has IPv6 address 2001:6b0:7::18</p>
<p>10: Test that all of your computers are listed with the following command:<br />
<code>host -l home.lan</code></p>
<p>The output should list all of your entered hosts:</p>
<p>home.lan name server ubuntu.home.lan.<br />
localhost.home.lan has address 127.0.0.1<br />
print-srv.home.lan has address 10.10.10.9<br />
router.home.lan has address 10.10.10.10<br />
server.home.lan has address 10.10.10.5<br />
ubuntu.home.lan has address 10.10.10.1<br />
xbox.home.lan has address 10.10.10.2</p>
<p>11: Test that the reverse lookup works:</p>
<pre> host 10.10.10.1</pre>
<p>Response:<br />
1.10.10.10.in-addr.arpa domain name pointer ubuntu.home.lan.</p>
<p><strong>Final words</strong><br />
Do not forget to update the serial every time you make any changes to a zone file.</p>
<p><strong>Referenses:</strong><br />
<a href="http://www.zaphu.com/2007/09/10/ubuntu-dns-server-guide-bind-caching-name-server-setup/" target="_blank">BIND Caching Name Server Setup</a><br />
<a href="http://www.zaphu.com/2007/09/14/ubuntu-dns-server-guide-bind-master-server-setup/">BIND Master Server Setup</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/51/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/51/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=51&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/09/setting-up-a-dns-for-the-local-network/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Generate a ssh key and disable password authentication on Ubuntu server</title>
		<link>http://lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/</link>
		<comments>http://lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 16:06:56 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=29</guid>
		<description><![CDATA[1. Generate the ssh key pair on the desktop computer: ssh-keygen 2. Copy the public key to the server: scp ~/.ssh/id_rsa.pub user@10.10.10.1: 3. Connect to the server: ssh user@10.10.10.1 4. Append the public key to authorized_keys and remove the uploaded copy: cat id_rsa.pub &#62;&#62; ~/.ssh/authorized_keys rm id_rsa.pub 5. Edit the ssh server configuration to make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=29&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Generate the ssh key pair on the desktop computer:<br />
<code>ssh-keygen</code></p>
<p>2. Copy the public key to the server:<br />
<code>scp ~/.ssh/id_rsa.pub user@10.10.10.1:</code></p>
<p>3. Connect to the server:<br />
<code>ssh user@10.10.10.1</code></p>
<p>4. Append the public key to authorized_keys and remove the uploaded copy:<br />
<code>cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys<br />
rm id_rsa.pub</code></p>
<p>5. Edit the ssh server configuration to make sure that public key authentication is enabled (it should be enabled by default):<br />
<code>sudo nano /etc/ssh/sshd_config</code></p>
<p>5.1 These entries must be set to yes:<br />
<code>RSAAuthentication yes<br />
PubkeyAuthentication yes</code></p>
<p>6. Reload the configuration:<br />
<code>sudo /etc/init.d/ssh reload</code></p>
<p>7. Disconnect from the server:<br />
<code>exit</code></p>
<p>8. Try connecting without the need to give the password to the ssh-client:<br />
<code>ssh user@10.10.10.1</code></p>
<p>You might need to give a password now to access your private key file, but you should not need to give the password to the ssh program.</p>
<p>9. Disable password authentication:<br />
<code>sudo nano /etc/ssh/sshd_config</code></p>
<p>9.1 The following settings should be set to no:<br />
<code>ChallengeResponseAuthentication no<br />
PasswordAuthentication no<br />
UsePAM no<br />
</code></p>
<p>9.2. Reload the configuration:<br />
<code>sudo /etc/init.d/ssh reload</code></p>
<p>10. Test that password authentication really is disabled:<br />
10.1 Disconnect from the server:<br />
<code>exit</code></p>
<p>10.2 Rename your private key file:<br />
<code>mv ~/.ssh/id_rsa ~/.ssh/id_rsa.backup</code></p>
<p>10.3 Try to reconnect to the server:<br />
<code>ssh user@10.10.10.1</code></p>
<p>This should produce a permission denied message: <em>&#8220;Permission denied (publickey).&#8221;</em></p>
<p>10.4 Restore your private key file:<br />
<code>mv ~/.ssh/id_rsa.backup ~/.ssh/id_rsa</code></p>
<p>Done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong><br />
Referens</strong></p>
<p><a href="http://www.debuntu.org/ssh-key-based-authentication" target="_blank">Debuntu</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=29&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/08/generate-a-ssh-key-and-disable-password-authentication-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Change to static ip on the Ubuntu Hardy Heron server</title>
		<link>http://lani78.wordpress.com/2008/08/07/change-to-static-ip-on-my-ubuntu-server/</link>
		<comments>http://lani78.wordpress.com/2008/08/07/change-to-static-ip-on-my-ubuntu-server/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:39:46 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=27</guid>
		<description><![CDATA[1.1: Edit /etc/network/interfaces: sudo nano /etc/network/interfaces 1.2: Change from dhcp to static: - iface eth0 inet dhcp + iface eth0 inet static + address 10.10.10.1 + netmask 255.255.255.0 + gateway 10.10.10.10 +        network 10.10.10.0 +        broadcast 10.10.10.255 2: Make sure that the name server is specified in &#8216;/etc/resolv.conf&#8217;: nameserver 10.10.10.10 3: Uninstall the dhcp-client (otherwise [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=27&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.1: Edit /etc/network/interfaces:<br />
<code>sudo nano /etc/network/interfaces</code></p>
<p>1.2: Change from dhcp to static:</p>
<pre>- iface eth0 inet dhcp
+ iface eth0 inet static
+        address 10.10.10.1
+        netmask 255.255.255.0
+        gateway 10.10.10.10
+        network 10.10.10.0
+        broadcast 10.10.10.255</pre>
<p>2: Make sure that the name server is specified in <em>&#8216;/etc/resolv.conf&#8217;</em>:<br />
<code>nameserver 10.10.10.10</code></p>
<p>3: Uninstall the dhcp-client (otherwise it will overwrite your changes on the next renew cycle!):<br />
<code>sudo apt-get remove dhcp3-client</code></p>
<p>4: Restart the network to use the new settings:<br />
<code>sudo /etc/init.d/networking restart</code></p>
<p>Done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=27&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/07/change-to-static-ip-on-my-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatically update Ubuntu Hardy Heron server with a ruby script</title>
		<link>http://lani78.wordpress.com/2008/08/06/automatically-update-ubuntu-hardy-heron-server-with-a-ruby-script/</link>
		<comments>http://lani78.wordpress.com/2008/08/06/automatically-update-ubuntu-hardy-heron-server-with-a-ruby-script/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 20:58:18 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Aptitude]]></category>
		<category><![CDATA[Auto]]></category>
		<category><![CDATA[Cron]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Permissions]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Smtp]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=10</guid>
		<description><![CDATA[Needs I wanted my newly installed Ubuntu server to check for updates every day and then automatically update itself if there were any new updates found. I search the web trying to find an existing solution that would work out of the box for me. But I am of course very picky of what I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=10&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Needs</strong></p>
<p>I wanted my newly installed <a href="http://www.ubuntu.com/products/WhatIsUbuntu/serveredition" target="_blank">Ubuntu server</a> to check for updates every day and then automatically update itself if there were any new updates found. I search the web trying to find an existing solution that would work out of the box for me. But I am of course very picky of what I want, so I could not found anything that met all my needs:</p>
<ul>
<li>Automatically check for updates every day.</li>
<li>Automatically download and install any updates that were found.</li>
<li>Report both success and failures to my e-mail and show me in the subject if the update failed or succeeded.</li>
<li>Use an external smtp-server with authentication.</li>
</ul>
<p>As I am also trying to learn the <a href="http://www.ruby-lang.org/en/" target="_blank">Ruby programming language,</a> besides from Linux, I decided to use it to create my update script.</p>
<p><strong>Installing Ruby</strong></p>
<p>Ruby is not installed by default on Hardy Heron but can easily be installed from the Ubuntu repositories:</p>
<p><code>sudo apt-get install ruby</code></p>
<p><strong>The Script</strong></p>
<pre><font face="courier new">
#!/usr/bin/ruby
##### Information ##############################################
# DESC:	This is an update script for Ubuntu Hardy Heron 8.04.
#	It will fetch any availible updates with aptitude and
#	install them. An e-mail with the result is then sent
#	using the configured smtp-server.
# AUTH:	Niklas "Lani" Lagergren
# REV.:	1.0 2008-08-06
#	* Initial release.
#
# COPY: No copyright claimed. No rights reserved. No warranty
#       given.
################################################################</code>

##### Configurable mail server options: ########################
# These parameters needs to be changed to match your enviorment
################################################################
@mail_server = 'your.mail-server.com'
@mail_port   = 25
@mail_domain = 'your.mail-domain.com'
@mail_user   = 'username'
@mail_pass   = 'password'
@mail_from   = 'from@your.mail-domain.com'
@mail_to     = 'to@somewhere.nil'

require 'net/smtp'

# Format date according to rfc 2822, example:
# Fri, 11 Jul 2008 09:13:20 +0200
def time_to_rfc2822(time)
  time.strftime('%a, %d %b %Y %H:%M:%S ') +
    if time.utc?
      '-0000'
    else
      off = time.utc_offset
    sign = off &lt; 0 ? '-' : '+'
    format('%s%02d%02d', sign, *(off.abs / 60).divmod(60))
  end
end

# Send e-mail according to the configuration in the instance variables.
def send_mail(subject, body)
  msg = "From: Ubuntu Server &lt;#{@mail_from}&gt;\r\n" +
    "To: Server Administrator &lt;#{@mail_to}&gt;\r\n" +
    "Subject: #{subject}\r\n" +
    "Date: #{time_to_rfc2822(Time.new)}\r\n" +
    "Message-Id: &lt;#{Time.new}@#{@mail_domain}&gt;\r\n" +
    "\r\n#{body}\r\n"

    Net::SMTP.start(@mail_server, @mail_port, @mail_domain, @mail_user,
      @mail_pass) do |smtp|
      smtp.send_message msg, @mail_from, @mail_to
    end
end

# Run aptitude commands to update the system and capture it's output.
puts 'Running aptitude...'
body = `aptitude update 2&gt;&amp;1`
body &lt;&lt; `aptitude dist-upgrade -y 2&gt;&amp;1` if $? == 0
body &lt;&lt; `aptitude clean 2&gt;&amp;1` if $? == 0

subject = "#{@mail_domain} update #{$? == 0 ? 'succeded' : 'FAILED'} #{Time.new}"

puts 'Sending mail...'
send_mail subject, body
puts 'Mail sent.'
</font>
</pre>
<p><strong>Set the script to run every day</strong><br />
Obviously you need to change the mail settings in the script as the comment suggest. Then save the script, I named it <em>&#8220;autoupdate&#8221;</em>. To run the script on a daily basis copy it to <em>&#8220;/etc/cron.daily&#8221;</em>. And don&#8217;t forget to set execute permissions on the script (and as I have the password stored in the file I also removed all <a href="http://www.zzee.com/solutions/linux-permissions.shtml" target="_blank">permissions</a> from <em>&#8220;others&#8221;</em>:<br />
<code><br />
sudo chmod 770 autoupdate<br />
</code></p>
<p><strong>Test the script</strong><br />
The easiest way to test the script is of course to just execute it:<br />
<code>sudo ./autoupdate</code></p>
<p>If you really want to make sure that it will execute when executed in the same way as when execute by the cron job you could run:</p>
<p><code>sudo run-parts /etc/cron.daily</code></p>
<p>Note that this will execute all scripts in the cron.daily folder. Another side note is that it probably won&#8217;t  run with the same permissions as when executed from the cron job, and it will probably take a long time to execute.</p>
<p>Now check your mailbox or the log files for the result:</p>
<p><code>cat /var/log/aptitude</code></p>
<p>Hopefully someone out there can benefit from this script as it is, or if you&#8217;re like me; tweak it to suite your own needs <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=10&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/06/automatically-update-ubuntu-hardy-heron-server-with-a-ruby-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
		<item>
		<title>Installed Ubuntu Hardy Heron (8.04) Server Today</title>
		<link>http://lani78.wordpress.com/2008/08/05/installed-ubuntu-hardy-heron-804-server-today/</link>
		<comments>http://lani78.wordpress.com/2008/08/05/installed-ubuntu-hardy-heron-804-server-today/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 18:43:54 +0000</pubDate>
		<dc:creator>lani78</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hardy Heron]]></category>
		<category><![CDATA[Installation Log]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://lani78.wordpress.com/?p=13</guid>
		<description><![CDATA[Just a reminder to myself that this was the day that I installed my Ubuntu server and with what options: DNS server LAMP server Mail server: Installed with &#8220;lani.nu&#8221; as domain and &#8220;Internet with smarthost&#8221; as option and set the smtp to mail.lani.nu. OpenSSH server Samba File server<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=13&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just a reminder to myself that this was the day that I installed my <a href="http://www.ubuntu.com/products/WhatIsUbuntu/serveredition" target="_blank">Ubuntu server</a> and with what options:</p>
<ul>
<li>DNS server</li>
<li>LAMP server</li>
<li>Mail server:<br />
Installed with &#8220;lani.nu&#8221; as domain and &#8220;Internet with smarthost&#8221; as option and set the smtp to mail.lani.nu.</li>
<li>OpenSSH server</li>
<li>Samba File server</li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/lani78.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/lani78.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lani78.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lani78.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lani78.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lani78.wordpress.com&amp;blog=4148305&amp;post=13&amp;subd=lani78&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lani78.wordpress.com/2008/08/05/installed-ubuntu-hardy-heron-804-server-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b495ed3ba39a647fef44472475fe89c8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lani78</media:title>
		</media:content>
	</item>
	</channel>
</rss>
