You should have already set up your LDAP server, and user authentication should work. (HowTos and Tips can be found on the net)
Our Linux server with Netatalk and OpenLDAP runs Ubuntu Linux 5.10. Our Mac Minis run MacOS X 10.4.4.
Get the files apple.schema and netinfo.schema from your MacOS X installation, and place it in your OpenLDAP schema directory (usually /etc/ldap/schema/. Insert these lines into your slapd.conf:
include /etc/ldap/schema/samba.schema
include /etc/ldap/schema/apple.schema
include /etc/ldap/schema/netinfo.schema
schemacheck on
If you restart slapd now, it probably complains about an attribute "authAuthority". I had to change several files. As I do not know how the Apple schemas are licensed, I tell you only how to change them:
apple.schema:For each user working on the Macs, you have to add some information into their LDAP entry:
This little script generates the necessary LDIF for ldapmodify
While inserting these attributes, I got the error message "no structuralObjectClass operational attribute". This means that the entry of my test user did not have this internal attribute. As we had schemacheck off until now, smbldap-useradd could create this entry undisturbed. A quick fix is to turn schemacheck off again. As soon as I will get to it, I'll repair the database (shut it down, slapcat to a backup file, insert the structuralObjectClass to every account where it is missing, and insert it into the database again using slapadd).
Insert an entry into your mounts subtree:
dn: cn=linuxfileserver.example.com:/NetUsers,ou=mounts,dc=myldap,dc=example,dc=com
objectClass: mount
cn: linuxfileserver.example.com:/NetUsers
mountDirectory: /Network/Servers/
mountOption: net
mountOption: url==afp://;AUTH=NO%20USER%20AUTHENT@linuxfileserver.example.com/NetUsers/
mountType: url
If mounts does not exist yet, add it with
dn: ou=mounts,dc=myldap,dc=example,dc=com
objectClass: organizationalUnit
ou: mounts
We run Ubuntu Linux 5.10, installing netatalk is as easy as apt-get install netatalk.
Insert the line exporting the home directories in /etc/netatalk/AppleVolumes.default:
/home NetUsers
Now try to log in on a Mac. The first login might take some time, as the Mac clutters your $HOME with all its Library, Documents and so on.
I do not know how secure AFP is, so you better a) use this in a safe environment or b) know exactly what you do.
I would like to thank Andreas Noback for giving me essential tips on how to set this up!