Guide · Synology · TrueNAS · Unraid
Back up a Mac folder to a NAS with rsync over SSH
Synology, TrueNAS and Unraid already have what a Mac needs to back up to them: SSH and rsync. You turn on SSH, add a key so the Mac can connect without a password, and choose a folder. The backup arrives on the NAS as ordinary files, and after the first run only new and changed files are copied. Below are the steps for each NAS, the folder path each one uses, and the permission mistakes that stop a key from working.
01
Why rsync over SSH, and not a network drive in Finder
- Ordinary files on the NAS. The backup is a folder of normal files, not a backup archive. Any computer that can open the shared folder can open them, without the app that copied them.
- Only new and changed files are copied. rsync compares the two sides first. The first backup copies everything; the ones after it are short.
- No network drive to keep connected. rsync connects to the NAS by itself, so the shared folder doesn't have to be open in Finder, and a dropped Finder connection can't stop a backup. Everything sent is encrypted.
You can run the same backup from Terminal, with nothing to install. macOS comes with rsync:
rsync -av --partial ~/Projects/ admin@nas.local:/volume1/backup/projects/The rest of this page is what to turn on in the NAS so that command works.
02
What you need
- The NAS's address on your network: a name such as
nas.local, or an IP address. - A NAS user that is allowed to connect over SSH. Each NAS allows different users, and this is the step people most often get wrong.
- A folder on the NAS that this user can write to.
- An SSH key for that user. A password is enough when you run a backup by hand. A scheduled or automatic backup needs a key, because nobody is there to type the password.
03 · DSM 7
Synology (DSM 7)
Open Control Panel → Terminal & SNMP → Terminal, tick Enable SSH service, and click Apply. The port is 22 unless you change it.
Use a user in the administrators group. DSM lets only members of that group connect over SSH; anyone else is refused, even with the right password.
Open Control Panel → User & Group → Advanced and tick Enable user home service. The key is stored in the user's home folder, and without this service the user has no home folder.
Open Control Panel → File Services → rsync and tick Enable rsync service. Then open Control Panel → Application Privileges → rsync and allow the user. DSM treats rsync over SSH as part of this service, so both need to be on.
Choose the destination. Shared folders are at
/volume1/<shared folder>, or/volume2/…on a second volume. Back up into a folder of its own, such as/volume1/backup/macbook, not into the top of the shared folder.
Key installed, but SSH still asks for a password? It is almost always the permissions. The NAS ignores the key when other users can write to the home folder, and a DSM home folder can be set that way. Connect once with the password and run:
chmod go-w ~
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys04 · TrueNAS 25
TrueNAS (Community Edition / SCALE)
Go to System → Services, turn SSH on, and tick Start Automatically so it comes back after a restart.
Go to Credentials → Users and edit the user that will receive the backup. Two fields matter:
Home Directory. A new user gets
/var/empty, which means no home folder, and so nowhere to store a key. Choose a folder on one of your datasets and tick Create Home Directory.Shell. rsync runs a command on the NAS, so the user needs a working shell:
bashorzsh, notnologin.Add the key. The simplest way: paste the public key into Authorized Keys on the same Edit User screen. To install it from the Mac with the user's password instead, turn on SSH password login enabled for the user and allow password logins in the SSH service. Turn both off once the key is in.
Choose the destination:
/mnt/<pool>/<dataset>, for example/mnt/tank/backup/macbook. The user needs permission to write there.
Older versions of your files. rsync keeps only the latest copy of each file. To be able to go back to an earlier day, add a Periodic Snapshot Task for the dataset, in Data Protection.
05 · Unraid 6.10+
Unraid
Go to Settings → Management Access and set Use SSH to Yes. On a new Unraid installation SSH is off.
Use the root user. It is the only user Unraid lets connect over SSH; share users cannot.
Add the key. Paste the public key into Users → root → SSH authorized keys and click Apply, or install it from the Mac with root's password.
Choose the destination. Shares are at
/mnt/user/<share>, for example/mnt/user/backup/macbook.
Key stopped working after a restart? Unraid runs from memory and rebuilds root's home folder at every boot. Since Unraid 6.9, root's key folder is kept on the flash drive, at /boot/config/ssh/root, so keys survive a restart. Check that authorized_keys is in that folder. An old go script that copies keys at boot is no longer needed.
06 · UniFi
UniFi NAS (UNAS)
A UniFi NAS works differently. UniFi Drive's built-in rsync doesn't accept a backup sent from a Mac over SSH, so the steps above don't apply. Logging in to the NAS as root over SSH does work. The setup, the folder paths under /volume/…/.srv/.unifi-drive/, and what Ubiquiti supports are on a separate page.
07 · RSync Pro
Setting it up in RSync Pro
RSync Pro is a Mac app that runs these same backups from a window, with saved setups, schedules and live sync. You turn on the same things in the NAS; you just don't need Terminal.
Create a sync task and set its destination to Remote.
Enter the NAS address and user. Discover lists the NAS and servers it finds on your network; if yours isn't listed, type its name or IP address.
Click Create Key, then Install Public Key, and type the user's password once. The app copies the key to the NAS and sets the permissions SSH expects. If the NAS doesn't accept passwords — a TrueNAS user without password login, for example — copy the public key from the app and paste it into the NAS settings instead. Or open Setup guide and pick the server type: it shows where SSH is switched on, checks the connection, then creates the key and installs it.
Click Test connection. Then choose the destination folder by browsing the NAS, or type the path from the section above.
Run it once by hand. The first run copies everything, so it takes longest. After that, turn on live sync, which sends each file a moment after you save it, or set a schedule: daily, weekly, or every set number of minutes. Live sync and schedules come with the one-time unlock.
Free for one sync task, run by hand. A one-time unlock adds live and scheduled sync, more sync tasks and Versions. No subscription, no account. Requires macOS 15 or later.
08
Mirror or copy
A normal rsync run copies: new and changed files go to the NAS, and nothing on the NAS is deleted. Mirror (--delete) also deletes from the NAS anything that is no longer on the Mac — including a file you deleted by mistake, a minute after you deleted it.
- For a backup, leave mirror off. The NAS then keeps files you have removed from the Mac.
- If you want the NAS to match the Mac exactly, turn mirror on and keep earlier versions on the NAS: snapshots on a TrueNAS dataset, or on a Synology volume formatted as Btrfs. Or use a Versions task in RSync Pro, which keeps dated copies you can restore.
- Before the first mirror run, do a dry run (
--dry-run, Simulation in RSync Pro). It lists what would be deleted, and deletes nothing. - From version 1.1, RSync Pro asks first. A mirror runs only after you have seen what it would copy and delete, and from which folders, and approved it; any change to the task asks again. It deletes after copying, stops past a limit, and by default moves what it deletes into
.rsyncpro-trashat the destination for 30 days. The direct download has 1.1; the App Store still has 1.0. - Point a mirror at its own folder, never at the top of a shared folder. With a slash at the end of the source (
Projects/), rsync copies what is inside the folder, not the folder itself. Mirrored to the top of a shared folder, that deletes every other folder there.
09
Limits worth knowing
- Live sync goes one way, from the Mac to the NAS. Changes made on the NAS reach the Mac only when you sync in the other direction, by hand or on a schedule.
- A new file is copied in full. rsync can send only the changed parts of a file the NAS already has. A new video or RAW file has nothing to compare against, so it takes as long as any other copy.
- iCloud Drive folders may not sync. The App Store version runs in the macOS sandbox, which can block folders inside iCloud Drive. Use a regular folder, for example in Documents, outside iCloud Drive.
- RSync Pro needs macOS 15 or later. The NAS needs nothing beyond what it comes with.
10
Questions
Do I need to connect to the NAS in Finder first?
No. rsync connects to the NAS over SSH by itself. The shared folder doesn't need to be open in Finder.
Does it work away from home?
Yes, as long as the Mac can reach the NAS's SSH port — over a VPN into your home network, for example. That is safer than opening port 22 to the internet.
Which user should I use?
On Synology, a member of the administrators group. On Unraid, root. On TrueNAS, a user with a home folder, a working shell and permission to write to the dataset — ideally one you create just for backups.
What does RSync Pro cost?
It is free for one sync task. Setting up more takes a one-time unlock. There is no subscription and no account.
Does the backup keep older versions?
Not on its own: rsync keeps the NAS copy current. Older versions come from the NAS — snapshots on TrueNAS, or on Btrfs volumes on Synology. With mirror off, files you delete on the Mac also stay on the NAS.
Can I run the same backup from Terminal?
Yes, but check which rsync you are running first: on a current Mac /usr/bin/rsync is openrsync, which rejects some options and runs a few others differently. rsync on a Mac: what changed lists them, tested on macOS 27.
Sources
Checked on 8 November 2026 against each vendor's documentation:
- Synology Knowledge Center, DSM 7: Terminal (SSH and the administrators group), User & Group → Advanced (user home service), rsync.
- TrueNAS Documentation, 25.04: SSH service, Managing users.
- Unraid Docs: User management, release notes for 6.9.0 (root's keys kept on the flash drive) and 6.10.0 (SSH authorized keys in the web UI).
A menu moved, or a step no longer matches your NAS? Write to support@bdtech.app and the page will be corrected.
Guides
Back up to a NAS, a remote Mac or a phone
-
UniFi NAS (UNAS)
UniFi Drive's built-in rsync doesn't accept a backup sent from a Mac. Logging in over SSH as root does, and this guide shows how. Tested on a UNAS Pro 4.
-
A Mac with no fixed IP (Tailscale)
Reach a Mac at another home, behind CGNAT or on the road, through Tailscale. No port forwarding, nothing to set up on the router.
-
An Android phone (Termux)
Termux gives an Android phone an SSH server and rsync, so a Mac can back up to it on port 8022. No root needed.
-
Your backups on an iPhone
An iPhone can't receive an rsync backup. Back up to a NAS or another Mac, then open the folder in the Files app.
-
A Windows PC
Share a folder on the PC and back up to it from Finder, or run rsync inside WSL for backups over the internet.