Tag Archives: OSX

Raspberry Pi as a Mac OSX file server

Update 1/5/2017, I’ve made configuration adjustments to /etc/netatalk/afpd.conf (2nd section below) and /etc/netatalk/AppleVolumes.default (third section below). I also added a section to enable the firewall.

Update 1/4/2017, previously I was unable to make this work with Samba (Windows file sharing for Linux) but after I rebuilt the Pi and followed my own instructions I was able to make this work.

This time I want my Raspberry Pi server to behave as another Mac sharing its files. It is incredibly easy. I use the latest image of Raspberry Pi Raspbian OS Jessie with PIXEL dated 2016-11-25.

First, we install netatalk (this software provides the functionality of an AFP file server used by Macs to share files).

sudo apt-get update
sudo apt-get install netatalk
sudo service avahi-daemon restart
sudo service netatalk restart

Second, I adjust the /etc/netatalk/afpd.conf file and use the following line at the end

– -tcp -noddp -uamlist uams_dhx2.so -nosavepassword -mimicmodel RackMac

Third, now from my Mac’s Finder I can see my raid5 tinypute appear as a shared PC, I can click it, and “Connect As” my tinypute user “pi” using its password and connect to pi’s home directory.

Fourth, if I wanted to add /mnt/raid5/storage to Mac’s file share I would edit /etc/netatalk/AppleVolumes.default. At the end of the file add the following

/mnt/raid5/storage  “RAID 5 Storage”   dperm:0750 fperm:0660 umask:7007

Then update the configuration of /mnt/raid5/storage so users can access it

sudo chgrp -R users /mnt/raid5/storage  #change the group to users (pi is a member of it)
sudo chmod -R ug+r+w,o-rwx /mnt/raid5/storage # change permissions (so pi can access it)

Fifth, install ufw if not already

sudo apt-get install ufw
sudo ufw allow 548
sudo ufw allow 5353

Sixth, restart the whole stack

sudo service avahi-daemon restart
sudo service netatalk restart
sudo service smbd restart

That’s it!