Due to Borg Issue #913
brew cask install borgbackup is no longer updated with the latest version. However don’t fear I’ve written a guide on installing Borg Backup from Source on Mac OS X.
- Create a new user
borgusing System Preferences
- Make a backup directory:
sudo chown borg borg
sudo chmod 700 borg
sudo chmod 700 client.name
Add this to
command="cd /Volumes/Backups/borg/client.name; /usr/local/bin/borg serve --restrict-to-path /Volumes/Backups/borg/client.name",no-port-forwarding,no-X11-forwarding,no-pty,no-agent-forwarding,no-user-rc ssh-rsa AAAAAAAAYOURKEYAAAAA== email@example.com
It needs to all be on one line The documentation indents it and makes it look nice, but this is incorrect.
client.name is a folder just for that client (You can host multiple repos on one Borg account safely) and
ssh-rsa AAAAAAAAYOURKEYAAAAA== firstname.lastname@example.org is what you would normally put in authorized_keys.
/Volumes/Backups/borg/ should be where you are keeping your backups.
/usr/local/bin/ is where Homebrew keeps your stuff.
chmod ugo+x(Set world executable, for some reason it wasn’t set)
borgas the borg user. If you get
-bash: /usr/local/bin/borg: Permission denied
Then you forgot the above step.
chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys
- Test using
ssh -l borg -i keyfile server.example
- It should not say
borg not foundbut should say
PTY allocation request failed on channel 0