<?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>Opinsys Oy</title>
	<atom:link href="http://www.opinsys.fi/feed" rel="self" type="application/rss+xml" />
	<link>http://www.opinsys.fi</link>
	<description>Linux-ratkaisut kouluille</description>
	<lastBuildDate>Mon, 22 Feb 2010 12:32:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>fi</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up NFSv4+Kerberos+Autofs5-ldap on Ubuntu 10.04 Alpha 2 (Lucid), part 7</title>
		<link>http://www.opinsys.fi/setting-up-nfsv4kerberosautofs5-ldap-on-ubuntu-10-04-alpha-2-lucid-part-7</link>
		<comments>http://www.opinsys.fi/setting-up-nfsv4kerberosautofs5-ldap-on-ubuntu-10-04-alpha-2-lucid-part-7#comments</comments>
		<pubDate>Mon, 22 Feb 2010 12:32:11 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>
		<category><![CDATA[autofs]]></category>
		<category><![CDATA[autofs5]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[nfs4]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=1065</guid>
		<description><![CDATA[After getting NFSv4 working, it'd be of course nice to automatically mount the nfs exported home directories. In this part I'm going through the steps to get school specific home directories mounted from a central server. Using autofs is an alternative to defining the mounted directories in /etc/fstab. It mounts the directories automatically when they are needed instead of doing it at boot time.]]></description>
			<content:encoded><![CDATA[<p>After getting NFSv4 working, it&#8217;d be of course nice to automatically mount the nfs exported home directories. In this part I&#8217;m going through the steps to get school specific home directories mounted from a central server. Using autofs is an alternative to defining the mounted directories in /etc/fstab. It mounts the directories automatically when they are needed instead of doing it at boot time. This especially handy in situations where some servers are not immediately available after boot because of network issues. Also the number of mounts is kept down when not needed, which has helped with server stability issues. Autofs mountpoints can be configured either statically for every client or centrally in ldap. Ldap configuration allows one to easily add new mountpoints without modifying every client separately.</p>
<p>In this setup there&#8217;s a single file server that has a separate subdirectory under /home for every school. The directories are:</p>
<ul>
<li>server:/home/school1</li>
<li>server:/home/school2</li>
<li>server:/home/school3</li>
</ul>
<p>The autofs.schema was installed in part 3 of this series. In addition to autofs-ldap package, also some entries are needed in ldap. First the basic data that autofs uses to recognize that it is configured:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>#!/bin/sh

ldapadd -D uid=admin,ou=People,dc=edu,dc=example,dc=org -x -W &lt;&lt; EOF
dn: ou=Automount,dc=edu,dc=example,dc=org
ou: Automount
objectClass: top
objectClass: organizationalUnit

dn: ou=auto.master,ou=Automount,dc=edu,dc=example,dc=org
ou: auto.master
objectClass: top
objectClass: automountMap
EOF</pre>
</div>
<p>We want to use autofs to mount directories under /home, so it needs to be defined:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>#!/bin/sh

ldapadd -D uid=admin,ou=People,dc=edu,dc=example,dc=org -x -W &lt;&lt; EOF
dn: cn=/home,ou=auto.master,ou=Automount,dc=edu,dc=example,dc=org
cn: /home
objectClass: top
objectClass: automount
automountInformation: ldap:ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org rsize=8192,wsize=8192
EOF</pre>
</div>
<p>This tells autofs to look for individual directories under the suffix ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org. The directories are then defined under the defined suffix:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>#!/bin/sh

ldapadd -D uid=admin,ou=People,dc=edu,dc=example,dc=org -x -W &lt;&lt; EOF
dn: ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org
ou: auto.home
objectClass: top
objectClass: automountMap

dn: cn=school1,ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org
cn: school1
objectClass: top
objectClass: automount
automountInformation: -fstype=nfs4,rw,sec=krb5 server.edu.example.org:/home/school1

dn: cn=school2,ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org
cn: school2
objectClass: top
objectClass: automount
automountInformation: -fstype=nfs4,rw,sec=krb5 server.edu.example.org:/home/school2

dn: cn=school3,ou=auto.home,ou=Automount,dc=edu,dc=example,dc=org
cn: school3
objectClass: top
objectClass: automount
automountInformation: -fstype=nfs4,rw,sec=krb5 server.edu.example.org:/home/school3
EOF</pre>
</div>
<p>Now the server side should be rocking and the clients need to be instructed to look for mountpoints in ldap. First autofs needs to be installed on the client machine:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo apt-get install autofs5-ldap ldap-utils</pre>
</div>
<p>And the following settings instructs autofs to use ldap as data storage and where in the ldap tree the information is stored:</p>
<p><strong>/etc/nsswitch.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>  automount: ldap</pre>
</div>
<p><strong>/etc/default/autofs</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>TIMEOUT=60
LDAP_URI=ldap://ldap.edu.example.org/
SEARCH_BASE="ou=auto.master,ou=Automount,dc=edu,dc=example,dc=org"

MAP_OBJECT_CLASS="automountMap"
ENTRY_OBJECT_CLASS="automount"
MAP_ATTRIBUTE="ou"
ENTRY_ATTRIBUTE="cn"
VALUE_ATTRIBUTE="automountInformation"</pre>
</div>
<p>Next restart /etc/init.d/autofs and /home/school{1|2|3} should mount automatically.</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-nfsv4kerberosautofs5-ldap-on-ubuntu-10-04-alpha-2-lucid-part-7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up NFSv4+Kerberos on Ubuntu 10.04 Alpha 2 (Lucid), part 6</title>
		<link>http://www.opinsys.fi/setting-up-nfsv4kerberos-on-ubuntu-10-04-alpha-2-lucid-part-6</link>
		<comments>http://www.opinsys.fi/setting-up-nfsv4kerberos-on-ubuntu-10-04-alpha-2-lucid-part-6#comments</comments>
		<pubDate>Sun, 21 Feb 2010 17:09:42 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[nfs4]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=1052</guid>
		<description><![CDATA[Next it's time to finally get files moving between the servers. For this we use NFSv4 that supports kerberos out-of-the-box also in Ubuntu. This part is based on the newest Lucid packages in the repositories, which should be pretty close to alpha 3 now.]]></description>
			<content:encoded><![CDATA[<p>Next it&#8217;s time to finally get files moving between the servers. For this we use NFSv4 that supports kerberos out-of-the-box also in Ubuntu. This part is based on the newest Lucid packages in the repositories, which should be pretty close to alpha 3 now.</p>
<p>The following documents were used to get the configuration working:</p>
<ul>
<li><a rel="nofollow" href="https://help.ubuntu.com/community/NFSv4Howto">https://help.ubuntu.com/community/NFSv4Howto</a></li>
<li><a rel="nofollow" href="http://mit.edu/kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-admin/Hostnames-for-KDCs.html#Hostnames-for-KDCs">MIT Kerberos manual: Hostnames for KDCs</a></li>
<li><a rel="nofollow" href="http://www-theorie.physik.unizh.ch/%7Edpotter/howto/kerberos">Doug Potter: Kerberos/LDAP/NFSv4 HOWTO</a></li>
</ul>
<p>The goal of the setup is to have a single file server that shares the following directories to clients over NFSv4 with kerberos authentication:</p>
<ul>
<li>/home/school1</li>
<li>/home/school2</li>
<li>/home/school3</li>
</ul>
<p>The server will not allow root to access other users&#8217; files which makes it possible to export the shares in potentially hostile environments as the compromise of a single client host does not expose all contents of the file server.</p>
<h2>Server settings</h2>
<p>The following packages are needed on the server:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>apt-get install nfs-kernel-server nfs-common</pre>
</div>
<p>Unlike NFSv3, NFSv4 uses a separate directory structure to share the directories. The actual content is mounted with mount &#8211;bind under this directory. Here we place the directories under /export:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo mkdir /export
sudo mkdir /export/home</pre>
</div>
<p>Then we instruct in /etc/fstab that /home should be mounted under /export/home. The following should be added in bottom of /etc/fstab:</p>
<p><strong>/etc/fstab</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>/home    /export/home   none    bind  0  0</pre>
</div>
<p>After this /export/home can be mounted with the following command and it is also automatically mounted when the system boots:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo mount /export/home</pre>
</div>
<p>Next configure the exports in /etc/exports to be exported to all nfs4 clients using kerberos:</p>
<p><strong>/etc/exports</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>/export         gss/krb5(rw,fsid=0,async,subtree_check,no_root_squash,crossmnt)
/export/home    gss/krb5(rw,async,subtree_check,no_root_squash)
/export/home/school1	gss/krb5(rw,async,subtree_check,root_squash,crossmnt)
/export/home/school2	gss/krb5(rw,async,subtree_check,root_squash,crossmnt)
/export/home/school3	gss/krb5(rw,async,subtree_check,root_squash,crossmnt)</pre>
</div>
<p>Next configure NFS to use kerberos:</p>
<p><strong>/etc/default/nfs-common</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>NEED_STATD=
STATDOPTS=
NEED_IDMAPD=yes
NEED_GSSD=yes</pre>
</div>
<p><strong>/etc/default/nfs-kernel-server</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>RPCNFSDCOUNT=10
RPCNFSDPRIORITY=0
RPCMOUNTDOPTS=
NEED_SVCGSSD=yes
RPCSVCGSSDOPTS=</pre>
</div>
<p>idmapd.conf needs to configured with proper Domain name for user/group name mappings:<br />
<strong>/etc/idmapd.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>[General]

Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = EDU.EXAMPLE.ORG

[Mapping]

Nobody-User = nobody
Nobody-Group = nogroup</pre>
</div>
<p>The NFS server version in Lucid supports only DES encryption which is not enabled by default. There is more information available in the bug reports:</p>
<ul>
<li><a rel="nofollow" href="https://bugs.launchpad.net/ubuntu/+source/krb5/+bug/512110">Bug report in Launchpad</a></li>
<li><a rel="nofollow" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521878">Bug report in Debian bug tracker</a></li>
</ul>
<p>For now DES can be enabled with the following settings:<br />
<strong>/etc/krb5.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>[libdefaults]
  allow_weak_crypto = <span>true</span>
  default_tgs_enctypes = des-cbc-crc
  default_tkt_enctypes = des-cbc-crc</pre>
</div>
<p>Next we need to create kerberos principals for the server and the clients. In this example all the principals are created on the server and copied to the clients. It is also possible to use kadmin remotely from the client machines.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo kadmin.local -q "addprinc -randkey nfs/server.edu.example.org"
sudo kadmin.local -q "ktadd -e des-cbc-crc:normal nfs/server.edu.example.org"

sudo kadmin.local -q "addprinc -randkey nfs/client1.edu.example.org"
sudo kadmin.local -q "ktadd -e des-cbc-crc:normal -k client1.keytab nfs/client1.edu.example.org"

sudo kadmin.local -q "addprinc -randkey nfs/client2.edu.example.org"
sudo kadmin.local -q "ktadd -e des-cbc-crc:normal -k client2.keytab nfs/client2.edu.example.org"</pre>
</div>
<p>Now copy the client1.keytab and client2.keytab to /etc/krb5.keytab on the client machines and make them only readable by root.</p>
<p>The server should now be ready after restarting the services:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo service gssd start
sudo service rpc_pipefs start
sudo /usr/sbin/rpc.gssd
sudo service idmapd start

sudo /etc/init.d/nfs-kernel-server restart</pre>
</div>
<p>The server functionality can be tested by trying to mount one of the exported shares locally:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo mount -t nfs4 -o sec=krb5 server.edu.example.org:/home/school1 /mnt</pre>
</div>
<h2>Client settings</h2>
<p>The following packages are needed on the client machines:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>apt-get install nfs-common krb5-user</pre>
</div>
<p>To avoid having to configure the kerberos server settings on each client separately, one can use DNS to store the settings as described in the previous posting.</p>
<p><strong>/etc/krb5.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>[libdefaults]
  default_realm = EDU.EXAMPLE.ORG
  allow_weak_crypto = <span>true</span>
  default_tgs_enctypes = des-cbc-crc
  default_tkt_enctypes = des-cbc-crc
  dns_lookup_kdc = <span>true</span>
  dns_lookup_realm = <span>true</span></pre>
</div>
<p><strong>/etc/default/nfs-common</strong> &#8211; idmapd and gssd need to be enabled</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>NEED_STATD=
STATDOPTS=
NEED_IDMAPD=yes
NEED_GSSD=yes
RPCGSSDOPTS="-vvv -rrr"  # <span>for</span> debugging</pre>
</div>
<p><strong>/etc/idmapd.conf</strong> &#8211; Domain must match the name defined on the server for user and group name mapping to work</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>[General]

Verbosity = 0
Pipefs-Directory = /<span>var</span>/lib/nfs/rpc_pipefs
Domain = EDU.EXAMPLE.ORG

[Mapping]

Nobody-User = nobody
Nobody-Group = nogroup</pre>
</div>
<p>After configuration nfs-common needs to be restarted (modules need to be loaded if they haven&#8217;t been loaded automatically):</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo modprobe nfs
sudo modprobe rpcsec_gss_krb5

sudo service idmapd start
sudo service gssd start
sudo service portmap restart</pre>
</div>
<p>Mounting the share should now work with mount command:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo mount -t nfs4 -o sec=krb5 server.edu.example.org:/home/school1 /home/school1</pre>
</div>
<p>If there are problems, restarting the client machine may help as sometimes picking up the kerberos setting hasn&#8217;t worked for me. I&#8217;m probably missing some service that requires restarting..</p>
<p>At this point we have no kerberos ticket, so the user should not be able to enter his own home directory:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>user$ cd /home/school1/user
-bash: cd: /home/school1/user: Permission denied</pre>
</div>
<p>After getting the ticket it should work:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>user$ kinit user@EDU.EXAMPLE.ORG
Password for user@EDU.EXAMPLE.ORG:
user$ cd /home/school1/user</pre>
</div>
<p>Root squash should also prevent root from entering directories for other users on the client machine:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>user$ cd /home/school1/otheruser
-bash: cd: /home/school1/otheruser: Permission denied

# cd /home/school1/otheruser
-bash: cd: /home/school1/otheruser: Permission denied</pre>
</div>
<p>Now give it a reboot and try again. Everything should be now working.</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-nfsv4kerberos-on-ubuntu-10-04-alpha-2-lucid-part-6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up OpenLDAP+Kerberos on Ubuntu 10.04 Alpha 2 (Lucid), part 5 &#8211; DNS settings</title>
		<link>http://www.opinsys.fi/setting-up-openldapkerberos-on-ubuntu-10-04-alpha-2-lucid-part-5-dns-settings</link>
		<comments>http://www.opinsys.fi/setting-up-openldapkerberos-on-ubuntu-10-04-alpha-2-lucid-part-5-dns-settings#comments</comments>
		<pubDate>Fri, 19 Feb 2010 11:51:21 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dnsmasq]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[OpenLDAP]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=1041</guid>
		<description><![CDATA[Kerberos requires every client to know where the server is located. This can be done either by using /etc/krb5.conf file or using DNS to distribute the information. Using DNS makes it easier to do changes in the network settings as not every client needs to be updated. Next we aim to minimize the amount of configuration needed for every client so configuring DNS properly is a logical first step.]]></description>
			<content:encoded><![CDATA[<p>Kerberos requires every client to know where the server is located. This can be done either by using /etc/krb5.conf file or using DNS to distribute the information. Using DNS makes it easier to do changes in the network settings as not every client needs to be updated. Next we aim to minimize the amount of configuration needed for every client so configuring DNS properly is a logical first step.</p>
<p>The following documents were used to get the configuration working:</p>
<ul>
<li><a rel="nofollow" href="https://help.ubuntu.com/community/NFSv4Howto">https://help.ubuntu.com/community/NFSv4Howto</a></li>
<li><a rel="nofollow" href="http://mit.edu/kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-admin/Hostnames-for-KDCs.html#Hostnames-for-KDCs">MIT Kerberos manual: Hostnames for KDCs</a></li>
<li><a rel="nofollow" href="http://www-theorie.physik.unizh.ch/%7Edpotter/howto/kerberos">Doug Potter: Kerberos/LDAP/NFSv4 HOWTO</a></li>
</ul>
<p>The goal of the setup is to have a single file server that shares the following directories to clients over NFSv4 with kerberos authentication:</p>
<ul>
<li>/home/school1</li>
<li>/home/school2</li>
<li>/home/school3</li>
</ul>
<p>The server will not allow root to access other users&#8217; files which makes it possible to export the shares in potentially hostile environments as the compromise of a single client host does not expose all contents of the file server.</p>
<p>The domain name used is edu.example.org and the NFS server will be the same machine as the kerberos server. The names used in this example map to following IPs:</p>
<ul>
<li>server.edu.example.org &#8211; 10.0.0.1</li>
<li>ldap.edu.example.org &#8211; 10.0.0.1</li>
<li>kerberos.edu.example.org &#8211; 10.0.0.1</li>
<li>client1.edu.example.org &#8211; 10.0.0.10</li>
<li>client2.edu.example.org &#8211; 10.0.0.11</li>
</ul>
<h3>DNS settings</h3>
<p>Before we start with the NFS setup, we need to make sure that name resolution for the server and clients works with fully qualified domain names (fqdn). Also reverse mappings need to be working for NFSv4+krb5 to work properly.</p>
<p>There are many DNS servers that can be used. Here we use dnsmasq:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo apt-get install dnsmasq</pre>
</div>
<p><strong>/etc/dnsmasq.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>domain-needed
domain=edu.example.org

ptr-record=1.0.0.10.in-addr.arpa.,<span>"server.edu.example.org"</span>
address=/server.edu.example.org/10.0.0.1

ptr-record=10.0.0.10.in-addr.arpa.,<span>"client1.edu.example.org"</span>
address=/client1.edu.example.org/10.0.0.10

ptr-record=11.0.0.10.in-addr.arpa.,<span>"client2.edu.example.org"</span>
address=/client2.edu.example.org/10.0.0.11</pre>
</div>
<p>After restarting dnsmasq and configuring it to be used in /etc/resolv.conf, it should resolve names properly both ways:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>$ nslookup server.edu.example.org

Server:		127.0.0.1
Address:	127.0.0.1#53

Name:	server.edu.example.org
Address: 10.0.0.1

$ nslookup 10.0.0.1

Server:		127.0.0.1
Address:	127.0.0.1#53

1.0.0.10.in-addr.arpa	name = server.edu.example.org.</pre>
</div>
<p>Make sure that also the client machine names resolve correctly.</p>
<p>In addition to having DNS server configured properly, if the /etc/hosts file has names configured, make sure that the FQDN is before the shortname, e.g.:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>10.0.0.1 server.edu.example.org server
10.0.0.10 client1.edu.example.org client1
10.0.0.11 client2.edu.example.org client2</pre>
</div>
<p>This makes sure that host mappings are not done from /etc/hosts using the shortname of the server.</p>
<p>While we are at it, let&#8217;s also add the SRV records for kerberos so that we don&#8217;t need to configure kerberos realms for every client separately:</p>
<p><strong>/etc/dnsmasq.conf</strong></p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>address=/kerberos.edu.example.org/10.0.0.1
address=/ldap.edu.example.org/10.0.0.1

txt-record=_kerberos.edu.example.org,"EDU.EXAMPLE.ORG"
srv-host=_kerberos._udp.edu.example.org,"kerberos.edu.example.org",88
srv-host=_kerberos._tcp.edu.example.org,"kerberos.edu.example.org",88
srv-host=_kerberos-master._udp.edu.example.org,kerberos."edu.example.org",88
srv-host=_kerberos-adm._tcp.edu.example.org,"kerberos.edu.example.org",749
srv-host=_kpasswd._udp.edu.example.org,"kerberos.edu.example.org",464</pre>
</div>
<p>Clients can now find the kerberos server automatically when the realm is given (e.g. kinit testuser@EDU.EXAMPLE.ORG). To set default realm, /etc/krb5.conf can be used:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
[libdefaults]
        default_realm = EDU.EXAMPLE.ORG
	dns_lookup_kdc = true
	dns_lookup_realm = true
</pre>
</div>
<p>Now the name server should be ready for the actual setup. The actual NFSv4+kerberos setup is described in the next part.</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-openldapkerberos-on-ubuntu-10-04-alpha-2-lucid-part-5-dns-settings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eikä siinä vielä kaikki!</title>
		<link>http://www.opinsys.fi/eika-siina-viela-kaikki</link>
		<comments>http://www.opinsys.fi/eika-siina-viela-kaikki#comments</comments>
		<pubDate>Fri, 19 Feb 2010 10:08:29 +0000</pubDate>
		<dc:creator>Eero Nukari</dc:creator>
				<category><![CDATA[Blogi]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=985</guid>
		<description><![CDATA[&#8221;Eikä siinä vielä kaikki!&#8221; -huudahduksella ylistetään ostosteeveen tuotteiden loputtomia lisäominaisuuksia. Nyt on aika tehdä sama Opinsysin linux-pääteratkaisusta. Tässä siis listattuna asiakkallamme hyödynnettävissä olevia ominaisuuksia, jotka tulevat linux-päätteratkaisun ohessa.
Vakio-ominaisuudet kaikille asiakkailla:

Käyttäjätunnukset ja kotihakemistot: Jokainen käyttäjä saa oman tunnuksen ja kotihakemiston. Koneelta kuin koneelta pääsee siis omiin tiedostoihin käsiksi.
Yhteiset kansiot: Koululle voidaan luoda yhteisiä kansioita käyttäjäryhmien mukaan. [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8221;Eikä siinä vielä kaikki!&#8221; -huudahduksella ylistetään ostosteeveen tuotteiden loputtomia lisäominaisuuksia. Nyt on aika tehdä sama Opinsysin linux-pääteratkaisusta. Tässä siis listattuna asiakkallamme hyödynnettävissä olevia ominaisuuksia, jotka tulevat linux-päätteratkaisun ohessa.</em></p>
<p>Vakio-ominaisuudet kaikille asiakkailla:</p>
<ul>
<li><strong>Käyttäjätunnukset ja kotihakemistot:</strong> Jokainen käyttäjä saa oman tunnuksen ja kotihakemiston. Koneelta kuin koneelta pääsee siis omiin tiedostoihin käsiksi.</li>
<li><strong>Yhteiset kansiot:</strong> Koululle voidaan luoda yhteisiä kansioita käyttäjäryhmien mukaan. Esimerkiksi opettajilla voi siis olla oma jaettu kansio ja koulun atk-kerholla oma. Kansiot ja niiden käyttöoikeudet tehdään koulun tarpeiden mukaan.</li>
<li><strong>Varmistuspalvelu:</strong> Käyttäjien kansiot ja koulun yhteiset kansiot varmistetaan päivittäin. Tiedostot ovat siis turvassa.<img class="size-full wp-image-992 alignright" title="Web-pohjainen käyttäjienhallinta" src="http://www.opinsys.fi/wp-content/uploads/2010/02/oiva1.png" alt="Web-pohjainen käyttäjienhallinta" width="244" height="163" /></li>
<li><strong>Käyttäjätietojen muokkaus web-selaimella:</strong> Uuden käyttäjän luonti tai salasanan vaihto toimii selaimen kautta. Tunnuksia ei siis tarvitse tilata puhelimella tai sähköpostilla tukipalvelun kautta. Opettaja-ryhmään kuuluvat käyttäjät voivat vaihtaa oppilaan salasanan &#8211; apua saa siis läheltä ja nopeasti.</li>
<li><strong>Ohjelmat käyttäjäryhmän tarpeiden mukaan:</strong> Valikossa näkyvät ohjelmat voidaan valita käyttäjäryhmän mukaan. Alakoululaisille ei näin tarvitse näkyä samoja ohjelmia kuin lukiolaisille. Myös ohjelmalistan muokkaukset hoituvat helposti web-selaimen kautta.</li>
<li><strong>Automatisoidut sammutukset:</strong> Koneita ei tarvitse manuaalisesti sammuttaa. Voitte itse päättää ajan, jonka jälkeen koneet sammuvat automatisoidusti, jos kukaan ei niitä käytä. Luonto ja lompakko kiittävät, kun sähköä säästyy.</li>
</ul>
<p>Erikseen tilattavia lisäominaisuuksia:</p>
<ul>
<li><strong>Käyttäjätunnukset web-sovelluksiin:</strong> Linux-palvelimen käyttäjäkantaa voi hyödyntää useat web-sovellukset kuten Moodle, wikit, sähköpostit jne. Näin oppilailla on vain yksi tunnus, joka toimii useissa järjestelmissä. Tämä helpottaa myös tunnusten ylläpitoa.</li>
<li><strong>Etäkäyttö:</strong> Myös kotoa pääsee käsiksi koulun kotihakemistoon ja tarvittaessa myös koulun ohjelmiin &#8211; kotikoneen käyttöjärjestelmästä riippumatta. Tiedostoja ei siis tarvitse enää usb-tikulla kantaa, jos kotoa nettiyhteys löytyy.</li>
<li><strong>Windows-yhteensopivuus:</strong> Koululle syystä tai toisesta jäävät windows-koneet voivat käyttää samoja käyttäjätunnuksia ja tallennustiloja kuin linux-päätteet.</li>
<li><strong>Info-tv:</strong> Koulujen info-taulut sisäiseen tiedottamiseen. Ruutujen sisältöä voidaan hallita web-selaimen kautta.</li>
<li><strong>Nettikulma:</strong> <a href="http://www.opinsys.fi/raggarin-kestavaa-tietotekniikkaa-nettikulma">Raggarin kestävää tietotekniikkaa</a> koulujen käytäville.</li>
</ul>
<p>Eikä siinäkään vielä kaikki! Uusia ominaisuuksia on tulossa lisää, kun saamme lähitulevaisuudessa uudet versiot käyttäjien-, laitteiden- ja työpöydänhallinnasta käyttöön. Myös seuraava versio Ubuntusta (<a href="http://www.ubuntu.com/testing/lucid/alpha1">Lucid Lynx</a>) tuonee mukanaan uudistuksia.</p>
<p>Eero Nukari, 050-529 4445, eero.nukari@opinsys.fi</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/eika-siina-viela-kaikki/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Onnistunut kärkikoulutapahtuma Ruovedellä</title>
		<link>http://www.opinsys.fi/onnistunut-karkikoulutapahtuma-ruovedella</link>
		<comments>http://www.opinsys.fi/onnistunut-karkikoulutapahtuma-ruovedella#comments</comments>
		<pubDate>Sun, 14 Feb 2010 11:13:01 +0000</pubDate>
		<dc:creator>Mikko Soikkeli</dc:creator>
				<category><![CDATA[Blogi]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=1019</guid>
		<description><![CDATA[Mainion nimen ovat Ruovedellä keksineet kärkikouluhankkeelle! Järkitehdas kuvaa mainiosti koulun kasvatustehtävää ja hanketta, jonka tarkoitus on miettiä järkeviä tapoja kehitää tieto- ja viestintätekniikan käyttöä oppimisessa.
Tällä viikolla Ruovedellä kokoontui nelisenkymmentä ihmistä tutustumaan Ruoveden Kirkonkylän koulun kärkikouluhankkeeseen. Tapahtuman parasta antia oli varmasti keskutelu oppilaskeskeisyydestä sekä opettajien aina muutoksessa tarvitsemasta koulutuksesta ja tuesta:  http://jarkitehdas.blogspot.com/
Opinsys osallistui tapahtumaan ja esitteli [...]]]></description>
			<content:encoded><![CDATA[<p>Mainion nimen ovat Ruovedellä keksineet kärkikouluhankkeelle! Järkitehdas kuvaa mainiosti koulun kasvatustehtävää ja hanketta, jonka tarkoitus on miettiä järkeviä tapoja kehitää tieto- ja viestintätekniikan käyttöä oppimisessa.</p>
<p>Tällä viikolla Ruovedellä kokoontui nelisenkymmentä ihmistä tutustumaan Ruoveden Kirkonkylän koulun kärkikouluhankkeeseen. Tapahtuman parasta antia oli varmasti keskutelu oppilaskeskeisyydestä sekä opettajien aina muutoksessa tarvitsemasta koulutuksesta ja tuesta: <a title="Järkitehdas-blogi" href="http://jarkitehdas.blogspot.com/" target="_blank"> http://jarkitehdas.blogspot.com/</a></p>
<p>Opinsys osallistui tapahtumaan ja esitteli vieraille toteuttamaamme Linux-ratkaisua.  Oppilaiden ajatuksia ratkaisusta löytyy <a title="Ylen uutispätkästä" href="http://areena.yle.fi/video/747267" target="_blank">Ylen uutispätkästä</a> <strong>4min kohdalla</strong>:</p>
<p><a title="Ylen verkkosivuilla uutisjuttu" href="http://yle.fi/alueet/tampere/2010/02/vanhat_koneet_uusiokaytetaan_oppilaiden_hyodyksi_1437836.html" target="_blank">Ylen verkkosivuilla uutisjuttu.</a></p>
<p>Uutisessa käy hyvin ilmi kuin Linuxilla toteutussa LTSP-ratkaisussa voidaan työpisteinä käyttää vanhatkin tietokoneet. Opinsysin kautta Ruovedenkin koulut ovat saaneet lisää tietokoneita koulujen käyttöön ja oppilaiden iloksi.</p>
<p>Kiitokset vielä Vesalle, Jukalle ja Markukselle sekä koulun opettajille tapahtuman järjestämisestä!</p>
<p><img class="aligncenter size-medium wp-image-802" title="opinsys_parempaa_oppimista" src="http://www.opinsys.fi/wp-content/uploads/2010/01/opinsys_parempaa_oppimista2-300x214.gif" alt="opinsys_parempaa_oppimista" width="300" height="214" /></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<p><img class="aligncenter size-medium wp-image-802" title="opinsys_parempaa_oppimista" src="http://www.opinsys.fi/wp-content/uploads/2010/01/opinsys_parempaa_oppimista2-300x214.gif" alt="opinsys_parempaa_oppimista" width="300" height="214" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/onnistunut-karkikoulutapahtuma-ruovedella/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webinaari LTSP-ratkaisun valintaperusteista 18.2 &#8211; Case Kemi</title>
		<link>http://www.opinsys.fi/webinaari-ltsp-ratkaisun-valintaperusteista-18-2-case-kemi</link>
		<comments>http://www.opinsys.fi/webinaari-ltsp-ratkaisun-valintaperusteista-18-2-case-kemi#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:01:03 +0000</pubDate>
		<dc:creator>Eero Nukari</dc:creator>
				<category><![CDATA[Blogi]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=969</guid>
		<description><![CDATA[
18.2 järjestetään webinaari koulujen linux-ratkaisuihin liittyen.
Suomen avoimen lähdekoodin keskuksen (COSS:in) oppilaitoksiin erikoistunut siipi EduCOSS järjestää 18.2 webinaarin teemalla &#8221;Minkälaiseen LTSP-ratkaisuun Kemi on päätymässä?&#8221;.  Lisätietoja ja ilmottautumiset webinaarin löytyvät EduCOSS:in blogista.  Webinaarin promoottorina toimii koulujen open source -ratkaisujen erikoismies Elias Aarnio. Case Kemiä esittelee hankkeen puuhamies Antti Turunen. Luonnollisesti myös Opinsysiltä olemme webinaarissa mukana.
Eero Nukari, eero.nukari@opinsys.fi, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-976" title="Tux matkalla Kemiin" src="http://www.opinsys.fi/wp-content/uploads/2010/02/tux1.jpg" alt="Tux matkalla Kemiin" width="122" height="144" /></p>
<p><em>18.2 järjestetään webinaari koulujen linux-ratkaisuihin liittyen.</em></p>
<p>Suomen avoimen lähdekoodin keskuksen (<a href="http://www.coss.fi/">COSS:in</a>) oppilaitoksiin erikoistunut siipi EduCOSS järjestää 18.2 webinaarin teemalla &#8221;Minkälaiseen LTSP-ratkaisuun Kemi on päätymässä?&#8221;.  Lisätietoja ja ilmottautumiset webinaarin löytyvät <a href="http://educoss.blogspot.com/2010/02/webinaari-182-minkalaiseen-ltsp.html">EduCOSS:in blogista</a>.  Webinaarin promoottorina toimii koulujen open source -ratkaisujen erikoismies Elias Aarnio. Case Kemiä esittelee hankkeen puuhamies Antti Turunen. Luonnollisesti myös Opinsysiltä olemme webinaarissa mukana.</p>
<p>Eero Nukari, eero.nukari@opinsys.fi, 050-529 4445</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/webinaari-ltsp-ratkaisun-valintaperusteista-18-2-case-kemi/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up OpenLDAP+Kerberos on Ubuntu 10.04 Alpha 2 (Lucid), part 4</title>
		<link>http://www.opinsys.fi/setting-up-openldap-kerberos-on-ubuntu-10-04-lucid</link>
		<comments>http://www.opinsys.fi/setting-up-openldap-kerberos-on-ubuntu-10-04-lucid#comments</comments>
		<pubDate>Fri, 05 Feb 2010 11:25:42 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=871</guid>
		<description><![CDATA[After getting OpenLDAP running properly and the schemas in place, the next step is to get Kerberos and AutoFS running on top of it to enable centrally managed automatic NFSv4+kerberos mounts to user home directories. Here we setup kerberos using OpenLDAP as the backend to store the principals. This allows one to easily replicate the data to slave servers.]]></description>
			<content:encoded><![CDATA[<p>After getting OpenLDAP running properly and the schemas in place, the next step is to get Kerberos and AutoFS running on top of it to enable centrally managed automatic NFSv4+kerberos mounts to user home directories. Here we setup kerberos using OpenLDAP as the backend to store the principals. This allows one to easily replicate the data to slave servers.</p>
<p>The following documents were used to get the configuration working:</p>
<ul>
<li><a href="https://help.ubuntu.com/community/SingleSignOn">Ubuntu SingleSignOn manual page</a></li>
</ul>
<p>This example uses kerberos realm EDU.EXAMPLE.ORG and the kdc uses fqdn kerberos.edu.example.org. The ldap database used is the same as configured in the earlier postings in this blog.</p>
<p>The following packages are needed to get kerberos working with ldap backend:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo apt-get install krb5-kdc-ldap krb5-kdc krb5-admin-server krb5-config krb5-user</pre>
</div>
<p>/etc/krb5.conf configures the database location that is needed before initializing the ldap database. In this example the ldap connection does not use TLS as both are running on the same server.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
[libdefaults]
        default_realm = EDU.EXAMPLE.ORG

[realms]
         EDU.EXAMPLE.ORG = {
             kdc = kerberos.edu.example.org
             admin_server = kerberos.edu.example.org
             master_kdc = kerberos.edu.example.org
             default_domain = edu.example.org
             database_module = ldap_edu.example.org
         }

[domain_realm]
         .edu.example.org = EDU.EXAMPLE.ORG
         edu.example.org = EDU.EXAMPLE.ORG

[dbmodules]
        ldap_edu.example.org = {
               db_library = kldap
               ldap_kerberos_container_dn = cn=krbcontainer,dc=edu,dc=example,dc=org
               ldap_kdc_dn = uid=admin,ou=People,dc=edu,dc=example,dc=org
               ldap_kadmind_dn = uid=admin,ou=People,dc=edu,dc=example,dc=org
               ldap_service_password_file = /etc/krb5.secrets
               ldap_servers = ldap://127.0.0.1
               ldap_conns_per_server = 5
        }</pre>
</div>
<p>To get the kerberos database initialized in the ldap directory, kdb5_ldap_util is used with valid ldap credentials. Kerberos will use these credentials to create the initial entries. Also KDC database master key is set at this point. Make it difficult and write it down somewhere.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo kdb5_ldap_util -D uid=admin,ou=People,dc=edu,dc=example,dc=org \
create -subtrees dc=edu,dc=example,dc=org -s -H ldap://localhost -r EDU.EXAMPLE.ORG

Password for "uid=admin,ou=People,dc=edu,dc=example,dc=org":
Initializing database for realm 'EDU.EXAMPLE.ORG'
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key:
Re-enter KDC database master key to verify: 

Kerberos container is missing. Creating now...</pre>
</div>
<p>Some hints for potential errors:</p>
<ul>
<li>
<i>&#8221;kdb5_ldap_util: Kerberos container location not specified while reading kerberos container information&#8221;</i> &#8211; /etc/krb5.conf has<br />
something wrong so that the realm doesn&#8217;t map to any databases</li>
<li>
<i>Server is unwilling to perform</i> &#8211; the ldap suffix configured for the realm is probably not valid</li>
</ul>
<p>Next the ldap user and password are stored for KDC to access and create principals:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo kdb5_ldap_util -D uid=admin,ou=People,dc=edu,dc=example,dc=org \
  stashsrvpw -f /etc/krb5.secrets uid=admin,ou=People,dc=edu,dc=example,dc=org</pre>
</div>
<p>Create an admin user named john who can modify the database:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo kadmin.local -q "addprinc john/admin@EDU.EXAMPLE.ORG</pre>
</div>
<p>Finally give the user access rights in /etc/krb5kdc/kadm5.acl:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
*/admin *</pre>
</div>
<p>KDC is configured in /etc/krb5kdc/kdc.conf with fairly basic configuration:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
[kdcdefaults]
    kdc_ports = 750,88

[realms]
    EDU.EXAMPLE.ORG = {
        database_name = /var/lib/krb5kdc/principal
        admin_keytab = FILE:/etc/krb5kdc/kadm5.keytab
        acl_file = /etc/krb5kdc/kadm5.acl
        key_stash_file = /etc/krb5kdc/stash
        kdc_ports = 750,88
        max_life = 10h 0m 0s
        max_renewable_life = 7d 0h 0m 0s
        master_key_type = des3-hmac-sha1
        supported_enctypes = aes256-cts:normal arcfour-hmac:normal des3-hmac-sha1:normal des-cbc-crc:normal des:normal des:v4 des:norealm des:onlyrealm des:afs3
        default_principal_flags = +preauth
    }</pre>
</div>
<p>After restarting krb5-kdc and krb5-admin-server one should be able to run kinit and get a kerberos ticket:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
$ kinit john/admin
Password for john/admin@EDU.EXAMPLE.ORG:
$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: john/admin@EDU.EXAMPLE.ORG

Valid starting     Expires            Service principal
01/28/10 03:10:20  01/29/10 03:10:20  krbtgt/EDU.EXAMPLE.ORG@EDU.EXAMPLE.ORG</pre>
</div>
<p>If you now dump the ldap database, the principal for john/admin is stored in dn: krbPrincipalName=john/admin@EDU.EXAMPLE.ORG,cn=EDU.EXAMPLE.ORG, cn=krbcontainer,dc=edu,dc=example,dc=org</p>
<p>More user principals can be added with kadmin and kadmin.local using the addprinc command. The <a href="https://help.ubuntu.com/community/SingleSignOn">Ubuntu SingleSignOn manual page</a> has more information about that.</p>
<h2>Desktop logins using kerberos</h2>
<p>Getting client machines to do PAM authentication using kerberos is easy. The libpam-krb5 package is needed for this:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo apt-get install libpam-krb5</pre>
</div>
<p>/etc/krb5.conf needs to be configured on the clients to point to the right server. This can be done also using proper name server settings to instruct the kerberos clients to contact the right server based on dns names.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
[libdefaults]
        default_realm = EDU.EXAMPLE.ORG

[realms]
         EDU.EXAMPLE.ORG = {
             kdc = kerberos.edu.example.org
             admin_server = kerberos.edu.example.org
             master_kdc = kerberos.edu.example.org
             default_domain = edu.example.org
         }</pre>
</div>
<p>On Lucid the PAM settings are added automagically and you should be ready to rock. Just make sure that the user you are authenticating as actually exists in /etc/passwd or ldap as kerberos does not provide nss services.</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-openldap-kerberos-on-ubuntu-10-04-lucid/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up OpenLDAP on Ubuntu 10.04 Alpha 2 (Lucid), part 3</title>
		<link>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-alpha-2-lucid-part-3</link>
		<comments>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-alpha-2-lucid-part-3#comments</comments>
		<pubDate>Mon, 01 Feb 2010 05:30:27 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[OpenLDAP]]></category>
		<category><![CDATA[schema]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=936</guid>
		<description><![CDATA[In this part I'm setting up ldap schemas for samba, autofs and kerberos. This is needed before the actual configuration for these can be done. Unfortunately I could not find ldif files for OpenLDAP for these, so the schema files need to be converted to ldif files. The tutorial at help.ubuntu.com instructs to use the slaptest tool for this.]]></description>
			<content:encoded><![CDATA[<p>In this part I&#8217;m setting up ldap schemas for samba, autofs and kerberos. This is needed before the actual configuration for these can be done. Unfortunately I could not find ldif files for OpenLDAP for these, so the schema files need to be converted to ldif files. The tutorial at <a href="https://help.ubuntu.com/9.10/serverguide/C/openldap-server.html">help.ubuntu.com</a> instructs to use the slaptest tool for this.</p>
<p>First get the tools and packages that contain the schemas that need to be converted. autofs.schema is in the autofs-ldap package, samba.schema is in the samba sources and kerberos.schema come with the krb5-kdc-ldap package.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo apt-get install dpkg-dev autofs-ldap krb5-kdc-ldap

apt-get source samba

cp ./samba-3.4.3/examples/LDAP/samba.schema .
cp /etc/ldap/schema/autofs.schema .
cp /usr/share/doc/krb5-kdc-ldap/kerberos.schema.gz .
gunzip kerberos.schema.gz
</pre>
</div>
<p>schema_convert.conf is a temporary file used to convert the schemas to ldif format:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/inetorgperson.schema
include samba.schema
include autofs.schema
include kerberos.schema
</pre>
</div>
<p>The actual conversion is done by running slaptest. It places the the resulting files under ldif_result directory. The files need to be cleaned a bit so that they are be imported. This is not exactly the nicest looking piece I&#8217;ve written, but it seems to do the trick.</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
mkdir ldif_result
slaptest -f schema_convert.conf -F ldif_result

cat ldif_result/cn=config/cn=schema/cn=*samba.ldif | \
egrep -v structuralObjectClass\|entryUUID\|creatorsName  | \
egrep -v createTimestamp\|entryCSN\|modifiersName\|modifyTimestamp | \
sed 's/dn: cn={.}samba/dn: cn=samba,cn=schema,cn=config/g' | \
sed 's/{.}samba/samba/' > samba.ldif

cat ldif_result/cn=config/cn=schema/cn=*autofs.ldif | \
egrep -v structuralObjectClass\|entryUUID\|creatorsName  | \
egrep -v createTimestamp\|entryCSN\|modifiersName\|modifyTimestamp | \
sed 's/dn: cn={.}autofs/dn: cn=autofs,cn=schema,cn=config/g' | \
sed 's/{.}autofs/autofs/' > autofs.ldif

cat ldif_result/cn=config/cn=schema/cn=*kerberos.ldif | \
egrep -v structuralObjectClass\|entryUUID\|creatorsName  | \
egrep -v createTimestamp\|entryCSN\|modifiersName\|modifyTimestamp | \
sed 's/dn: cn={.}kerberos/dn: cn=kerberos,cn=schema,cn=config/g' | \
sed 's/{.}kerberos/kerberos/' > kerberos.ldif

sudo cp samba.ldif autofs.ldif kerberos.ldif /etc/ldap/schema/
</pre>
</div>
<p>The ldif files are now placed under /etc/ldap/schema/ and can be added using ldapadd:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/samba.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/autofs.ldif
sudo ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/kerberos.ldif
</pre>
</div>
<p>Next it&#8217;s time to finally get to kerberos, I hope..</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-alpha-2-lucid-part-3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kärkikoulut esillä Educa 2010 messuilla</title>
		<link>http://www.opinsys.fi/karkikoulut-esilla-educa-2010-messuilla</link>
		<comments>http://www.opinsys.fi/karkikoulut-esilla-educa-2010-messuilla#comments</comments>
		<pubDate>Thu, 28 Jan 2010 09:10:26 +0000</pubDate>
		<dc:creator>Mikko Soikkeli</dc:creator>
				<category><![CDATA[Blogi]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=952</guid>
		<description><![CDATA[Arjen tietoyhteiskunnan neuvottelukunta ja Opetushallitus sekä lukuisat muut toimijat  ovat Tieto- ja viestintätekniikka koulun arjessa – hankkeessa kehittämässä tulevaisuuden koulun toimintamalleja.  Käytännössä Opinsysin osastolla 1c20 messuilla on kaksi kärkikoulua kertomassa mitä se tarkoittaa.  Tervetuloa Opinsysin osastolle 1c20.
Perjantai
10.30-11.30  Kärkikoulu Ruovedeltä tavattavissa Opinsysin osastolla
13.00-14.00  Kärkikoulu Kauniaisista tavattavissa Opinsysin osastolla
14.15–15.00  Parhaat toimintamalli, Lankinen &#8211; Linden &#8211; Vahtivuori-Hänninen. Messukeskuksen [...]]]></description>
			<content:encoded><![CDATA[<p>Arjen tietoyhteiskunnan neuvottelukunta ja Opetushallitus sekä lukuisat muut toimijat  ovat Tieto- ja viestintätekniikka koulun arjessa – hankkeessa kehittämässä tulevaisuuden koulun toimintamalleja.  Käytännössä Opinsysin osastolla 1c20 messuilla on kaksi kärkikoulua kertomassa mitä se tarkoittaa.  Tervetuloa Opinsysin osastolle 1c20.</p>
<p><strong>Perjantai</strong><br />
10.30-11.30  Kärkikoulu Ruovedeltä tavattavissa Opinsysin osastolla</p>
<p>13.00-14.00  Kärkikoulu Kauniaisista tavattavissa Opinsysin osastolla</p>
<p>14.15–15.00  Parhaat toimintamalli, Lankinen &#8211; Linden &#8211; Vahtivuori-Hänninen. Messukeskuksen salissa 1.</p>
<p><strong>Lauantai</strong></p>
<p>10.30-11.30  Kärkikoulu Ruovedeltä tavattavissa Opinsysin osastolla</p>
<p>12.00-13.00  Kärkikoulu Kauniaisista tavattavissa Opinsysin osastolla</p>
<p>13.00–13.45  Tieto- ja viestintätekniikka koulun arjessa -hankkeen tuloksista, Vahtivuori-Hänninen &amp; Kankaanranta. Sali 2.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">
<h2 class="subHeading" style="margin: 0pt 20px; font-size: 16px; font-weight: normal; font-style: italic; line-height: 25px; color: #3d5948; font-family: Georgia;"><span>Opetushallituksen valitsemista kärkikoulusta, joissa etsitään parhaita käytänteitä tieto- ja viestintätekniikan (TVT) hyödyntämiseen suomalaisissa kouluissa. </span></h2>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/karkikoulut-esilla-educa-2010-messuilla/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up OpenLDAP on Ubuntu 10.04 Alpha 2 (Lucid), part 2</title>
		<link>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-lucid-part2</link>
		<comments>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-lucid-part2#comments</comments>
		<pubDate>Wed, 27 Jan 2010 23:51:13 +0000</pubDate>
		<dc:creator>Veli-Matti Lintu</dc:creator>
				<category><![CDATA[Developer's blog]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[OpenLDAP]]></category>

		<guid isPermaLink="false">http://www.opinsys.fi/?p=921</guid>
		<description><![CDATA[After getting OpenLDAP running, the next step is to get TLS authentication working. There are various tutorials around the net telling how to make  self-signed certificates using openssl. Googling reveals quite a few problems with using self-signed certificates created with openssl with debian's and ubuntu's slapd that uses gnutls. For this example I'll use the certtool that comes with the gnutls-bin.]]></description>
			<content:encoded><![CDATA[<p>After getting OpenLDAP running, the next step is to get TLS authentication working. This continues the <a href="/en/setting-up-openldap-on-ubuntu-10-04-alpha2">first part</a>.</p>
<p>The following documents were used:</p>
<ul>
<li><a href="https://help.ubuntu.com/9.10/serverguide/C/openldap-server.html">Ubuntu&#8217;s OpenLDAP documentation for Karmic</a></li>
<li><a title="HowtoForge's article on installing OpenLDAP on Karmic" href="http://www.howtoforge.com/install-and-configure-openldap-on-ubuntu-karmic-koala">HowtoForge&#8217;s article on installing OpenLDAP on Karmic</a></li>
<li><a href="http://www.gnu.org/software/gnutls/manual/html_node/Invoking-certtool.html">gnutls manual: Invoking certtool</a></li>
<li><a href="http://ubuntuforums.org/showthread.php?t=1241136">GnuTLS howto on Ubuntuforums</a></li>
</ul>
<p>There are various tutorials around the net telling how to make  self-signed certificates using openssl. Googling reveals quite a few problems with using self-signed certificates created with openssl with debian&#8217;s and ubuntu&#8217;s slapd that uses gnutls. For this example I&#8217;ll use the certtool that comes with the gnutls-bin.</p>
<p>The goal here is to create CA (ca.edu.example.org) and sign the server key  with the CA. The client can then use the CA certificate to check the  validity of the server key (ldap.edu.example.org) that is used by the slapd daemon.</p>
<p>To get started the gnutls-bin package needs to be installed:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>sudo apt-get install gnutls-bin</pre>
</div>
<p>First the CA key needs to be created and signed:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
certtool --generate-privkey --outfile slapd-ca-key.pem
certtool --generate-self-signed --load-privkey slapd-ca-key.pem \
--outfile slapd-ca-cert.pem</pre>
</div>
<p>This asks questions about the usage of the certificate. To get a ten year one I used the following options:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
Common name: ca.edu.example.org
The certificate will expire in (days): 3650

Does the certificate belong to an authority? (y/N): y
Path length constraint (decimal, -1 for no constraint): -1
Will the certificate be used to sign other certificates? (y/N): y</pre>
</div>
<p>Next create the server key and certificate:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
certtool --generate-privkey --outfile slapd-server.key
certtool --generate-certificate --load-privkey slapd-server.key \
--outfile slapd-server.crt --load-ca-certificate slapd-ca-cert.pem \
 --load-ca-privkey slapd-ca-key.pem</pre>
</div>
<p>The common name needs to be ldap.edu.example.org for the slapd certificate:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
Common name: ldap.edu.example.org
The certificate will expire in (days): 3650
Will the certificate be used for signing (required for TLS)? (y/N): y
Will the certificate be used for encryption (not required for TLS)? (y/N): y</pre>
</div>
<p>The files slapd-ca-cert.pem slapd-server.{crt|key} need to be copied to /etc/ssl/certs/ where slapd can load them:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo install -D -o openldap -g openldap -m 600 slapd-server.crt \
             /etc/ssl/certs/slapd-server.crt
sudo install -D -o openldap -g openldap -m 600 slapd-server.key \
             /etc/ssl/certs/slapd-server.key
</div>

The following ldif sets the configuration parameters in cn=config:
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
#!/bin/sh

ldapmodify -Y EXTERNAL -H ldapi:/// << EOF
dn: cn=config
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ssl/certs/slapd-ca-cert.pem
-
add: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ssl/certs/slapd-server.crt
-
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ssl/certs/slapd-server.key
EOF</pre>
</div>
<p>On the client copy ca-cert.pem to /etc/ldap/ssl:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
sudo install -o root -g root -m 644 slapd-ca-cert.pem \
             /etc/ssl/certs/slapd-ca-cert.pem
</div>

Then add the following in /etc/ldap/ldap.conf:
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
URI ldap://ldap.edu.example.org/
TLS_CACERT /etc/ssl/certs/slapd-ca-cert.pem</pre>
</div>
<p>Now we can check that TLS works:</p>
<div style="border-width: 1px;background:#ddffaa;margin-bottom:10pt;">
<pre>
ldapsearch -x -h ldap.edu.example.org -ZZ -b dc=edu,dc=example,dc=org</pre>
</div>
<p>It should return the organizationalUnits created earlier.</p>
<p>Thanks for all the people who have documented the various tools needed to get this working! Next it's time to get to see how the kerberos setup has changed..</p>
<p>Veli-Matti Lintu</p>
]]></content:encoded>
			<wfw:commentRss>http://www.opinsys.fi/setting-up-openldap-on-ubuntu-10-04-lucid-part2/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
