<?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>Colin.Guthr.ie &#187; apple</title>
	<atom:link href="http://colin.guthr.ie/tag/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://colin.guthr.ie</link>
	<description>Illegitimi non carborundum</description>
	<lastBuildDate>Thu, 03 Nov 2011 14:04:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Integrating Login and Home Directory on OS X Leopard Clients</title>
		<link>http://colin.guthr.ie/2009/07/integrating-login-and-home-directory-on-os-x-leopard-clients/</link>
		<comments>http://colin.guthr.ie/2009/07/integrating-login-and-home-directory-on-os-x-leopard-clients/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 15:58:01 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mandriva]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://colin.guthr.ie/?p=95</guid>
		<description><![CDATA[I've recently been dabbling in OS X related stuff. One of the things that is important to me is ensuring that my login details and users can use the OS X machine just the same as any other. Not that I really have any need for this, seeing as I'm pretty much the only user, [...]]]></description>
			<content:encoded><![CDATA[<p>I've recently been dabbling in OS X related stuff. One of the things that is important to me is ensuring that my login details and users can use the OS X machine just the same as any other. Not that I really have any need for this, seeing as I'm pretty much the only user, but I like to learn these things <img src='http://colin.guthr.ie/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-95"></span>So I've been using LDAP for a while (again, just because I can) and so I figured configuring login details would be easy. Well it's not totally easy, but it's also not too hard. One of the first things is that the default LDAP schemas etc. on Mandriva are probably a little old fashioned these days. It seems Apple and others are pushing ahead with RFC2307 spec for user accounts etc. The good news is that it seems pretty easy to support this with a few minor modifications.</p>
<h2>Configuring OpenLDAP on Mandriva 2009.1</h2>
<p>First up, install the openldap-extra-schemas package. This contains the apple.schema needed to make things work. This schema builds on the outdated samba (2) schema which is now sadly replaced with an updated version for samba3. I guess this will change in the future but for the time being, I hacked up the necessary attribute definitions into a schema that I included prior to the apple one. Here are the changes I made to the default /etc/openldap/slapd.conf file:</p>
<pre>--- etc/openldap/slapd.conf	2009-07-27 16:22:58.000000000 +0100
+++ /etc/openldap/slapd.conf	2009-07-25 15:58:56.000000000 +0100
@@ -15,11 +15,11 @@
 include	/usr/share/openldap/schema/krb5-kdc.schema
 include /usr/share/openldap/schema/kerberosobject.schema
 include	/usr/share/openldap/schema/misc.schema
-include	/usr/share/openldap/schema/nis.schema
+#include	/usr/share/openldap/schema/nis.schema
 include	/usr/share/openldap/schema/openldap.schema
-include /usr/share/openldap/schema/autofs.schema
+#include /usr/share/openldap/schema/autofs.schema
 include /usr/share/openldap/schema/samba.schema
-include /usr/share/openldap/schema/kolab.schema
+#include /usr/share/openldap/schema/kolab.schema
 include /usr/share/openldap/schema/evolutionperson.schema
 include /usr/share/openldap/schema/calendar.schema
 include /usr/share/openldap/schema/sudo.schema</pre>
<p>As you can see, nis, autofs and kolab schemas have all been disabled. Both nis and autofs are covered in RFC2307. I only disabled kolab as it builds on some of the definitions of those other two and thus caused errors on startup. I don't use kolab so this isn't a problem. It is no doubt quite simple to fix these errors.</p>
<p>As I like to keep changes to system config files to a minimum I didn't changes things much ore than that. There is a file, /etc/openldap/schemas/local.schema in which I did the real work. Here is the contents of that file:</p>
<pre># This is a good place to put your schema definitions
include /home/setup/ldap/schemas/mozilla.schema

# (cg) This schema is needed for OSX Automount integration.
# In order to activate it, you need to disable:
#  o nis.schema
#  o automount.schema
#  o kolab.schema
include /usr/share/openldap/schema/rfc2307bis.schema

include /etc/openldap/schema/pre-apple.schema
include /usr/share/openldap/schema/apple.schema</pre>
<p>The rfc2307bis and apple schemas are part of the openldap-extra-schemas package mentioned above. The pre-apple one is one I crafted myself based on comments on other blogs and due to the fact our samba schema is now version three. Here is my pre-apple.schema file:</p>
<pre>#ident $Id: apple.schema,v 1.42 2005/01/27 23:40:38 jtownsen Exp $
#
# Preliminary Apple OS X Native LDAP Schema
# This file is subject to change.
#

# (cg) Some definitions needed prior to including the apple.schema
# See: http://mattfleming.com/node/190#comment-656
# Both the below sections are included (but commented) in the official
# apple.schema in the openldap-schemas-extra package.

# ===== From (historical) samba.schema

##
## Account flags in string format ([UWDX     ])
##
attributetype ( 1.3.6.1.4.1.7165.2.1.4 NAME 'acctFlags'
 DESC 'Account Flags'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE )

##
## Password timestamps &amp; policies
##
attributetype ( 1.3.6.1.4.1.7165.2.1.3 NAME 'pwdLastSet'
 DESC 'NT pwdLastSet'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.5 NAME 'logonTime'
 DESC 'NT logonTime'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.6 NAME 'logoffTime'
 DESC 'NT logoffTime'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.7 NAME 'kickoffTime'
 DESC 'NT kickoffTime'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.8 NAME 'pwdCanChange'
 DESC 'NT pwdCanChange'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.9 NAME 'pwdMustChange'
 DESC 'NT pwdMustChange'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

#
# string settings
#
attributetype ( 1.3.6.1.4.1.7165.2.1.10 NAME 'homeDrive'
 DESC 'NT homeDrive'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{4} SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.11 NAME 'scriptPath'
 DESC 'NT scriptPath'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.12 NAME 'profilePath'
 DESC 'NT profilePath'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.13 NAME 'userWorkstations'
 DESC 'userWorkstations'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.17 NAME 'smbHome'
 DESC 'smbHome'
 EQUALITY caseIgnoreIA5Match
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )

#
# user and group RID
#
attributetype ( 1.3.6.1.4.1.7165.2.1.14 NAME 'rid'
 DESC 'NT rid'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

attributetype ( 1.3.6.1.4.1.7165.2.1.15 NAME 'primaryGroupID'
 DESC 'NT Group RID'
 EQUALITY integerMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

# ==== From (commented out) apple.schema

#
# Authentication authority attribute 1.3.6.1.4.1.63.1000.1.1.2.16.1
#
attributetype (
 1.3.6.1.4.1.63.1000.1.1.2.16.1
 NAME 'authAuthority'
 DESC 'password server authentication authority'
 EQUALITY caseExactIA5Match
 SUBSTR caseExactIA5SubstringsMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )

#
# ACL object attributes 1.3.6.1.4.1.63.1000.1.1.1.21
#
attributetype (
 1.3.6.1.4.1.63.1000.1.1.1.21.1
 NAME 'apple-acl-entry'
 DESC 'acl entry'
 EQUALITY caseExactMatch
 SUBSTR caseExactSubstringsMatch
 SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )</pre>
<p>So with all that done, I was able to restart my LDAP server without any errors. That is not to say that the data in it is any good, but it seemed to work for me. I've not tried creating new users etc yet tho', so problems could come out of the woodwork yet!</p>
<h2>Configuring OS X For LDAP Authentication</h2>
<p>This topic is really rather well <a href="http://mattfleming.com/node/190">covered already</a> but it's actually very trivial. Just use "Directory Utility" to add the remote server, First off Show the Advanced controls and create an LDAPv3 definition for your server and select the RFC2307 mappings. I didn't do any custom mappings on top of this. I just left everything as default. Once you've done this you can just add your server as a new source and everything should work. You can verify by using the command "id" on the terminal. Just pass in an LDAP username and it should give you their details.</p>
<p>Quite simple so far huh? Well that is half the story. The second part is mounting the home directory.</p>
<h2>Mounting Home Directory via LDAP Provided AutoFS Information</h2>
<p>Big thanks go to Rajeev Karamchedu for his <a href="http://rajeev.name/blog/2007/12/09/integrating-leopard-autofs-with-ldap/">excellent series of posts</a> on this topic. The information he gives is pretty much bang on. The most important part is about using the new autofs schema (three options are given in the Mandriva autofs package, but Apple only supports one), and the fact that the definition <strong>must</strong> live at the base dn. This is annoying as I'd rather it lived inside ou=Mounts but such is life. Hopefully Apple will support this in due course. One important deviation from Rajeev's post (and I'm not sure if this is just due to newer versions of OS X) is that I could not use the automountKey=/ syntax for defining my home directories. I had to use * in place of / This makes sense as it is the default wildcard for just about everything, but it's still a deviation.</p>
<p>You should also make sure that the "insecure" option is added to the /etc/exports file on the NFS server. OS X mounts come from a port number &gt; 1024, so this option is needed. In a private network it's not really insecure as the name suggests, so don't loose too much sleep over it <img src='http://colin.guthr.ie/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I'd recommend testing a manual NFS mount first. In actual fact, I would strongly recommend this as I found a rather annoying infinite loop in the autofs stuff. It continually tried to mount /home/.DS_Store over and over when I didn't have the insecure option set. I'm not sure why it did this, but I had to kill automountd to stop it.</p>
<h2>Conclusion</h2>
<p>So things work. It wasn't all that hard, and now I have login and auth for my network users on OS X. I've not tried getting autofs working again with Linux clients with the new structure imposed by OS X. It does support the structure, but I'm not sure if the location (e.g. not under ou=Mounts) or the wildcard will cause proplems (for the former it's configurable on Linux so shouldn't be a problem).</p>
<p>Apple could do better with their LDAP lookup (e.g. support a search base!), but all in all it's pretty good.</p>
<p>Thanks go to Matt Flemming and Rajeev Karamchedu for their excellent writeups. Hope this regurgitation helps some people in similar situations.</p>
<div class='sociable'><div><span class='sociable-tagline'>Share and Enjoy:</span></div><ul><li><a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;title=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients&amp;bodytext=I%27ve%20recently%20been%20dabbling%20in%20OS%20X%20related%20stuff.%20One%20of%20the%20things%20that%20is%20important%20to%20me%20is%20ensuring%20that%20my%20login%20details%20and%20users%20can%20use%20the%20OS%20X%20machine%20just%20the%20same%20as%20any%20other.%20Not%20that%20I%20really%20have%20any%20need%20for%20this%2C%20seeing%20as%20I%27m%20pret" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/digg.png" class="sociable-img sociable-hovers" title="Digg" alt="Digg" /></a></li><li><a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;title=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/stumbleupon.png" class="sociable-img sociable-hovers" title="StumbleUpon" alt="StumbleUpon" /></a></li><li><a rel="nofollow"   href="http://delicious.com/post?url=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;title=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients&amp;notes=I%27ve%20recently%20been%20dabbling%20in%20OS%20X%20related%20stuff.%20One%20of%20the%20things%20that%20is%20important%20to%20me%20is%20ensuring%20that%20my%20login%20details%20and%20users%20can%20use%20the%20OS%20X%20machine%20just%20the%20same%20as%20any%20other.%20Not%20that%20I%20really%20have%20any%20need%20for%20this%2C%20seeing%20as%20I%27m%20pret" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/delicious.png" class="sociable-img sociable-hovers" title="del.icio.us" alt="del.icio.us" /></a></li><li><a rel="nofollow"   href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;t=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/facebook.png" class="sociable-img sociable-hovers" title="Facebook" alt="Facebook" /></a></li><li><a rel="nofollow"   href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;submitHeadline=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients&amp;submitSummary=I%27ve%20recently%20been%20dabbling%20in%20OS%20X%20related%20stuff.%20One%20of%20the%20things%20that%20is%20important%20to%20me%20is%20ensuring%20that%20my%20login%20details%20and%20users%20can%20use%20the%20OS%20X%20machine%20just%20the%20same%20as%20any%20other.%20Not%20that%20I%20really%20have%20any%20need%20for%20this%2C%20seeing%20as%20I%27m%20pret&amp;submitCategory=science&amp;submitAssetType=text" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/yahoobuzz.png" class="sociable-img sociable-hovers" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a></li><li><a rel="nofollow"   href="http://twitter.com/home?status=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients%20-%20http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/twitter.png" class="sociable-img sociable-hovers" title="Twitter" alt="Twitter" /></a></li><li><a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F&amp;title=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients&amp;annotation=I%27ve%20recently%20been%20dabbling%20in%20OS%20X%20related%20stuff.%20One%20of%20the%20things%20that%20is%20important%20to%20me%20is%20ensuring%20that%20my%20login%20details%20and%20users%20can%20use%20the%20OS%20X%20machine%20just%20the%20same%20as%20any%20other.%20Not%20that%20I%20really%20have%20any%20need%20for%20this%2C%20seeing%20as%20I%27m%20pret" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/googlebookmark.png" class="sociable-img sociable-hovers" title="Google Bookmarks" alt="Google Bookmarks" /></a></li><li><a rel="nofollow"   href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/identica.png" class="sociable-img sociable-hovers" title="Identi.ca" alt="Identi.ca" /></a></li><li><a rel="nofollow"   href="http://slashdot.org/bookmark.pl?title=Integrating%20Login%20and%20Home%20Directory%20on%20OS%20X%20Leopard%20Clients&amp;url=http%3A%2F%2Fcolin.guthr.ie%2F2009%2F07%2Fintegrating-login-and-home-directory-on-os-x-leopard-clients%2F" ><img src="http://colin.guthr.ie/wp-content/plugins/sociable-30/images/default/16/slashdot.png" class="sociable-img sociable-hovers" title="Slashdot" alt="Slashdot" /></a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://colin.guthr.ie/2009/07/integrating-login-and-home-directory-on-os-x-leopard-clients/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

