Wednesday, November 16, 2011

Using a Scientific Linux/CentOS/RHEL 6 Server for Time Machine

I recently tried to setup a Scientific Linux 6 server as a backup volume for Time Machine. I based my steps on these instructions for Ubuntu, but I thought there was enough differences that I thought it was worth posting what worked for me. I used Scientific Linux 6, but it should work just as well for CentOS 6 and Red Hat Enterprise Linux 6.

A few assumptions made in these instructions, you will want to replace them as appropriate:
  • The user's username is "user".
  • The Linux server has a hostname of "". If you don't have a hostname in DNS, you can use the server's IP address instead.

First, we need to setup the server:

1. Install the EPEL repository. I already had it on the machine, but if it's not yet installed, read and follow the instructions at

2. Install netatalk from the EPEL repository:
# yum install netatalk

3. Add the following line to the end of /etc/netatalk/afpd.conf:
- -transall -uamlist, -nosavepassword -advertise_ssh

4. Create the TimeMachine directory in the user's home directory or wherever you want it:
$ mkdir /home/user/TimeMachine

5. Add the following two lines to the end of /etc/netatalk/AppleVolumes.default. Note that I commented out the ~ line that was already present since I didn't want to enable home directory access; I just want to use this for Time Machine:
/home/user/TimeMachine TimeMachine allow:user cnidscheme:dbd options:userdots,upriv

6. Configure netatalk to be started when the system boots:
# chkconfig netatalk on

7. Start netatalk:
# service netatalk start

8. Open the AFP port in the firewall. Go to System, Administration, Firewall. Click Other Ports, Add, then scroll down until you find Port 548, Protocol tcp, Service afpovertcp. Select it and click OK. Repeat for Port 548, Protocol udp, Service aftpovertcp. Click Apply, then close the Firewall Configuration window.

Now, on your Mac:

1. Verify that you can connect to the server. From the Finder's Go menu, choose Connect to Server. Enter the server address afp:// and click Connect. You should be prompted for a username and password.

2. Configure Time Machine to allow you to use network volumes for Time Machine. Enter the following command in
$ defaults write TMShowUnsupportedNetworkVolumes 1

3. Go to System Preferences, select Time Machine. Enable Time Machine and select your mounted TimeMachine volume. You will be prompted for a username and password that Time Machine will use to connect when it's performing the backup.