Upon installing Mac OS X 10.7 Lion I discovered one niggling issue. I was unable to connect to my Gentoo Netatalk AFP server. Any connection attempts would result in the following error:

AFP error when connecting to a Netatalk AFP server on Gentoo Linux

After some Googling, I discovered a quick fix to the problem. Basically, if you haven’t updated your Netatalk config file for some time, you wouldn’t have UAMS DHX2 enabled by default. To enable UAMS DHX2 support, do the following:

Edit afpd.conf:

# vi /etc/netatalk/afpd.conf

Make sure “uams_dhx2.so” is in the “-uamlist” options at the end of the file. For instance, mine looks like this:

- -noddp -transall -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2.so -nosavepassword -advertise_ssh -udp

Then restart the Netatalk server. Please note that the init script may be different depending on your distribution.

# /etc/init.d/atalk restart

Now you should be able to connect your OS X 10.7 Lion installation to a Linux AFP server. It should be noted, however, that despite AFP working in this setup, I have been unable to get Time Machine to work with these settings. If you’ve managed to get Time Machine to work with Netatalk, post a comment!