Install netatalk and avahi-daemon with

sudo apt-get install netatalk avahi-daemon

then create a backup directory, e.g.,


and make sure it is assigned to an owner (e.g., macuser) for which you know the password. Now modify


adding at the end this line

- -tcp -noddp -uamlist,, -nosavepassword

and modify


adding at the end (change <username> with whatever you picked before)

/disk/timemachine TimeMachine allow:<username> cnidscheme:dbd options:usedots,upriv,tm

Now create the file


and write in it

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <name replace-wildcards="yes">%h</name>

You are done, just restart the services

restart netatalk
restart avahi-daemon