Skip to content

Instantly share code, notes, and snippets.

@m3nu
Created May 24, 2019 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m3nu/85849692c88126516db1865bd73b535e to your computer and use it in GitHub Desktop.
Save m3nu/85849692c88126516db1865bd73b535e to your computer and use it in GitHub Desktop.
Mount Borg Repo for Other Users
# Tested on CentOS7/AWS
$ sudo adduser borg-1
$ sudo adduser borg-2
$ sudo yum install -y borgbackup
$ sudo mkdir /mnt/repo
$ sudo chown borg-1:borg-1 repo
# Allow access to other users
$ sudo -u borg-1 borg mount -o allow_other w66xh7lj@w66xh7lj.repo.borgbase.com:repo /mnt/repo
$ ll
total 0
drwxr-xr-x. 1 borg-1 borg-1 0 May 24 01:17 repo
$ sudo -u borg-2 ls repo
nyx2.local-remote-test-repo-2018-12-14T12:51:06 nyx2.local__test-repo-2019-05-17T18:59:18
nyx2.local-remote-test-repo-2018-12-14T14:08:00 nyx2.local__test-repo-2019-05-19T11:12:52
...
# Unmount and try without `allow_other`
$ sudo -u borg-1 borg umount /mnt/repo
# Mount without allowing access
$ sudo -u borg-1 borg mount w66xh7lj@w66xh7lj.repo.borgbase.com:repo /mnt/repo
$ sudo -u borg-2 ls -l
ls: cannot access repo: Permission denied
total 0
d????????? ? ? ? ? ? repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment