
Apple computers communicate with one another using the Apple Filing Protocol (AFP). Using the freely-available implementation of this protocol called Netatalk, Ubuntu (currently Hardy Heron 8.04) can interface with Mac OS X (currently Leopard 10.5.2) and you can set up a AppleShare file server on a Ubuntu machine that is accessible to Macs on your local area network (LAN). The following guide will get you started.
To install Netatalk you have two options. Both are outlined below, but I recommend the second method for security reasons.
Installation Option One - Clear Text Passwords
Netatalk can be installed from the Ubuntu package repositories by simply using the aptitude package management program. To do so, execute the following commands in the terminal. (This may require that the Ubuntu install disk is in the CD drive.)
sudo aptitude install netatalk
Unfortunately, this pre-compiled package only allows the use of clear text passwords (instead of encrypted passwords) due to legal reasons. This is fine for the purposes of file sharing on a LAN behind a firewall. However, there are a few things to keep in mind. First, clear text passwords may only be 8 or fewer characters in length and, thus, all users that intend to login in to and use the Netatalk AppleShare file server must have such a password. Second, if you are using OS X 10.5 (Leopard), clear text passwords are not permitted by default. However, it is easy to enable clear text passwords by executing the following command in a terminal on your Mac. (Note: Due to the page width, the command is wrapped below. But, it should be typed all on one line.)
Installation Option Two - Encrypted Passwords
In order to install Netatalk so that it works natively with OS X Leopard-that is, allows encrypted passwords-the program must be recompiled using the appropriate SSL libraries. First we need to install some developer packages, which may require that the Ubuntu install disk be in the CD drive. At the command prompt type:
sudo aptitude install devscripts dpkg-dev
Next, install some password checker and SSL libraries.
Make a directory to hold the Netatalk source code, move to it, and download the code.
cd netatalk
apt-get source netatalk
Now, move to the source code directory (the version number may change), switch to the root user, resolve and install the build dependencies for Netatalk, and build with the SSL option enabled (I’ve included several build options to suppress some error messages that arise because the build is not signed). The last commands below install the build and exit the root user.
sudo su
apt-get build-dep netatalk
DEB_BUILD_OPTIONS=ssl debuild -i -us -uc -b
debi
exit
Finishing Up
If you used installation method two above (the custom build) then execute the following command to finish up. This command suppress updates of your custom Netatalk build. The program will break if Ubuntu tries to update it.
That’s it. Now you can connect to the Ubuntu AFP server by using Go > Connect to Server... in Finder on your Mac and entering your Ubuntu user name and password. By default your home directory on the Ubuntu machine will be served. To serve other directories you will have to modify the /etc/netatalk/AppleVolumes.default file. This file is well commented to guide you. One thing I wanted to do was to have a shared directory where anyone using my LAN could drop or retrieve files. The easiest way to do this (in order to get all the permissions correct) is to simply create a shared user on the Ubuntu machine in whose home directory shared content can be stored.
Congratulations, now your Ubuntu machine can serve files to Macs running OS X on the LAN. But it would be nice if your new Ubuntu Apple File Server broadcast its presence on the network and showed up in Finder on your Macs. This can be done using a program called Avahi which discovers and broadcasts services just like Bonjour. I show you how to install and configure Avahi in this post.
This post is one of five in a series on how to integrate Ubuntu into a Mac OS X Network. Check out the others linked to below.
Ubuntu Guide: Configure a Netatalk File Server Based on Apple Filing Protocol (AFP)
Ubuntu Guide: Configure Avahi to Broadcast Services via Bonjour to Mac OS X
Ubuntu Guide: Configure Vinagre to Share the Screen with Mac OS X
Ubuntu Guide: Configure a Firefly (mt-daapd) Streaming Media Server for iTunes and Front Row
Ubuntu Guide: Configure Netatalk to Share a USB Printerr

Add New Comment
Viewing 16 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)
April 29, 2008 at 9:02 am
[...] you followed this guide, your Ubuntu machine can now serve files to Macs on your local area network (LAN) ...
April 29, 2008 at 10:47 am
[...] you have installed Netatalk following this post, it is fairly straightforward to share a USB printer connected to your ...
April 29, 2008 at 10:49 am
[...] using Netatalk to deposit files. If Netatalk is not installed on your Ubuntu machine, then see this post to ...
April 30, 2008 at 9:22 am
[...] 1) Ubuntu Guide: Configure a Netatalk File Server Based on Apple Filing Protocol (AFP) [...]
May 1, 2008 at 2:18 pm
[...] a series on how to integrate Ubuntu into a Mac OS X Network. Check out the others linked to ...
May 29, 2008 at 2:31 pm
[...] I can easily share files between my Macs (mostly running OS X 10.5.3) and the Ubuntu machine (see this ...
December 20, 2008 at 1:30 am
[...] ubuntu-guide-configure-a-netatalk-file-server-based-on-apple-filing-protocol-afp [...]
January 2, 2009 at 12:36 pm
[...] Netatalk from source. Following the steps in the Kremalicious article as well as information from this guide, I configured ...