I run a Linux server in the house which I use for all sorts of things–a staging server, git server, backup and file server–all of which works well enough for me as a geek. But for the wife and kids, who are not into shell commands (for whatever reason), the server is of no use if they can’t use it via Finder.
For that there are two nifty packages that make browsing your Linux machine from an your mac as easy any other mac on the network. One package, called
netatalk installs makes your Linux box AFP capable (Apple Filing Protocol), the other, called
avahi, makes your Linux box discoverable,
I’ve been using these packages for a while now and until recently, setup has been sketchy and stability hasn’t been all that great. In recent months however, this has changed considerably and now both packages work (and work well) almost right out of the box. So here are some step-by-step instructions for making your Linux box discoverable and browsable by Mac computers on the network:
- If you are on the Linux box, starr a shell, otherwise ssh into your Linux box.
- Get the
avahipackages (check first to see that they’re not installed already).
$ sudo apt-get install netatalk avahi-daemon
- Configure netatalk.
$ sudo vim /etc/netatalk/afpd.conf
Uncomment the default line or create your own parameter string (⇧G in VI will move the cursor to the end of the file).
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2.so -nosavepassword
- [optional] Configure the volumes to share. By default netatalk sets some basic user privileges and directories to share. You can customize these to your liking.
$ sudo vim /etc/netatalk/AppleVolumes.default
- Start the AFP and Bonjour services.
$ sudo /etc/init.d/netatalk restart ; # starts netatalk $ sudo restart avahi-daemon ; # restarts avahi-daemon
Now look at Finder on your Mac and you’ll see your Linux box in the “Shared” list in the Finder sidebar.
For more on these two packages, visit the Netatalk and Avahi websites.