Replies: 46 comments 18 replies
-
For example, will a mere running as
be sufficient to be able to backup all files including the files belonging to root? |
Beta Was this translation helpful? Give feedback.
-
I'd also appreciate some further guidance or links to relevant external documentation. Ultimately I would like to see and use Vorta in the (non-root) user Gnome system tray (Ubuntu 18.04) with auto-start on system start (or at least Gnome login) and have the backups Vorta schedules ran with root permissions so that a full system backup can be taken. To start with, I tried to just get it to run manually from a terminal window running in Gnome and failed:
At this point Vorta did not appear to be running but it may have been only the system tray part of it that was broken. I killed the background process and just ran as a normal user, which at least allows me to backup some files until I get this figured out...
|
Beta Was this translation helpful? Give feedback.
-
Just as an idea, did not test that yet: if one uses the fat-binary of borg, it could be owned by root:root and be suid. Then vorta could run as normal user and borg would run as root. This does NOT work with scripts though (e.g. shell or python), only with binaries. |
Beta Was this translation helpful? Give feedback.
-
Not a fan of such workarounds. With Borg being suid, an attacker could change any file on the machine. (via Personally I'd either put your own user in some kind of "admin group" that has access to |
Beta Was this translation helpful? Give feedback.
-
I guess that statements on the front page like "One place to view all point-in-time archives and restore individual files." gave me a different impression of what Vorta is for. Maybe it's just me that interprets this as it being a complete backup solution for a system but if it is only supposed to be used for some files that's fine, I'll look into what this Borgmatic alternative is instead. Thanks for the advice. |
Beta Was this translation helpful? Give feedback.
-
Vorta is for desktops environments, not servers. Your use case belongs more to the server space. There, a headless solution, like Borgmatic or a shell script will work better with regards to permissions. If you're motivated you can surely run the backup task with You can still use Vorta to access and restore those backup repos. I just don't recommend circumventing your local permissions and giving a user application deep system access without knowing your exact situation. |
Beta Was this translation helpful? Give feedback.
-
@m3nu wrote
Äh, well, but.... for example some /etc files are still as important as user files. And databases. So I think, as discussed above, at least the preferred-by-the-maintainers view should be explained. If you - for understandable reasons - do not suggest/recommend Vorta for these purposes, this should be mentioned. |
Beta Was this translation helpful? Give feedback.
-
Fair enough. For context, I'm approaching the Linux backup in the same way as I have always backed up my Windows desktop environment (using tools that take regular differential backups of the entire system to enable both a quick bare-metal restore and fine-grained protection against short-term user file corruption/ransomware/human error). Given how hard I've found it to identify reliable software to achieve this I can entirely believe that it's just not a backup strategy that fits Linux as well as Windows and I will most likely learn more about better strategies as I read about Borgmatic. I like what I've seen of Vorta so far and may well keep using it as part of a more complete backup solution. |
Beta Was this translation helpful? Give feedback.
-
If you guys are really keen on doing backups as root, then I suggest to just run the The PR for this should be quite simple. This option could be enabled under Misc or as env variable. Would this solve your use case? |
Beta Was this translation helpful? Give feedback.
-
That's not something I've done before (sudo has always involved me typing a password). I guess that this approach would still open up the risk of an attacker using I think from a security perspective, the sort of solution I was dreaming of would involve a secure way (requesting root/sudo password for example) of configuring a script to run as root such that it can do a full backup of the system, with the scheduling and monitoring available via Vorta but without the ability for a user-account compromise to allow arbitrary root file access. The more I think about, the more it sounds like a fantasy world and I would think all similar systems I've used on Windows would have suffered from this same risk. |
Beta Was this translation helpful? Give feedback.
-
You can currently do that with a combination of Timeshift and vorta. I don't know if it is feasible, to do something similar in vorta. |
Beta Was this translation helpful? Give feedback.
-
No. The passwordless sudo can be restricted to specific commands. So only Only |
Beta Was this translation helpful? Give feedback.
-
(just let me drop it: thank you all - apart from working for/on borgbackup - for the - honestly - fruitful discussion of this topic.) |
Beta Was this translation helpful? Give feedback.
-
Well, "it depends". locally-mounted-filesystem repoonce you start doing "sudo borg create", your repo files will be owned by root and also your borg cache might be in /root and be owned by root (depends on sudo options). if you then use borg as non-root, you'll run into permission issues when accessing the repo files and either the same for the cache files or you'll have 2 different caches, one for root and one for the non-priv. user (might be a space and time consumption issue). ssh: repofiles in a ssh: remote repo are owned by the ssh login user, so no problem here. one can use someuser@localhost to access local filesystem files and avoid the permission issues. borg extractIf one uses root to archive files not owned by the non-privileged user, one of course also needs root to correctly restore them (including file ownership and maybe also some other metadata). If you are a non-privileged user, you can't chown stuff away from yourself. |
Beta Was this translation helpful? Give feedback.
-
Valid issues, @ThomasWaldmann . Didn't think of the cache and permissions. The ssh-workaround mentioned already has its own issue #53. The generalized version would be "Set custom borg command", which could be To make this work, the user needs to set up SSH keys on their local machine and be very disciplined with any command he runs. I'm fine with adding this for power-users who need it in special cases and know what they are doing. |
Beta Was this translation helpful? Give feedback.
-
@samuel-w, not sure I understand the use case of restricting root to |
Beta Was this translation helpful? Give feedback.
-
Its possible if you create the backup as root and then fix the permissions with chown |
Beta Was this translation helpful? Give feedback.
-
I want to reduce the scope of root usage as much as possible to reduce security issues. |
Beta Was this translation helpful? Give feedback.
-
Although I understand the security concept of restricting root access to the minimum required, it doesn't very useful to me for this application to restrict it to only |
Beta Was this translation helpful? Give feedback.
-
@samuel-w I think we have 2 different use cases for running Vorta as root in mind.
I was thinking about 2nd use case, because I currently do my system backups via Borgmatic and mainly looked for a nice GUI to browse the archive. But the first use case looks interesting to use Vorta for unattended non-GUI backups of the whole system. |
Beta Was this translation helpful? Give feedback.
-
What's the final consensus on this topic? Should the main instance run under |
Beta Was this translation helpful? Give feedback.
-
I think this is a very important issue and the key advantage of BackInTime over Vorta. There's no good reason why Vorta shouldn't also be able to do backups of root-owned files. It's a crucial feature which would enable system backup&restore (/ full system backups) which is a critical element of any efficient&robust IT system so I'm really surprised there isn't really any proper (GUI-including) solution for GNU/Linux and that isn't already built into Vorta. It shouldn't be needed to run Vorta as root to get it working – afaik it would even be bad practice (to run any GUI as root) from a security standpoint (even though that's how BiT implemented it). One could simply add directories to sources and maybe check an option like "Backup root-owned files too". If that option is checked the user would need to enter the root password (only) once, maybe using pkexec, whenever the backup profile config was changed which would then set up/alter the cron job (or however the automatic backups are implemented). |
Beta Was this translation helpful? Give feedback.
-
Yes, a vorta systemd unit to run backups as root would be highly appreciated. I only backup my home but there are quite a few docker volumes owned by root because they run android etc. Vorta is for desktops only is loosing as argument pretty quickly. I noticed that the yay wrapper for pacman also has many cache files owned by root in a normal users homedir. I hope for a solution one day :) |
Beta Was this translation helpful? Give feedback.
-
I don't get the "Vorta is for desktop" argument. It's obvious that some user files are saved on root folders or are owned by root. I'm currently using BackInTime only for this, but BackInTime uses Rsync with hardlinks, and because of that I lose space when storing the backup. I would like to have a GUI to make Borg backups with root permissions, and Vorta is the only one I know so far. Is there any way to make possible to Vorta run as root and perform the scheduled backups on root owned files? |
Beta Was this translation helpful? Give feedback.
-
The @palto42 suggestion (using the polkit file to call through pkexec, and adding a desktop file to ~/.config/autostart folder) worked for me. The only problem is that it asks for the root password every time I start the computer (and not only when I open the GUI). I'm ok with this for now. |
Beta Was this translation helpful? Give feedback.
-
It seems to me that the subject here is closed down, so I do apologize to wake "already" up now: Statues To have one system only: I can imagine, that Borg is not interested to put work in a non commercial usecase. So I would accept any answer. But an simple answer. Now I am searching and searching and reading and not much understanding beside maybe... |
Beta Was this translation helpful? Give feedback.
-
I'm new to this and am struggling to grasp where exactly we stand with using Vorta for backing up files owned as root. I don't need the whole system, just some files from within my /home and /etc, maybe /usr that are owned by root. I did manage to run it with "sudo vorta", but some things are a bit wonky like some have mentioned. I didn't understand the polkit file thing. I only backup locally. |
Beta Was this translation helpful? Give feedback.
-
I have question about what exactly is in /etc. When I searched, it would be configuration files. Aren't configuration files not (also) in the .config folder in the home folder? The problem with the permissions for me, is not the files that are not backed up. The problem is more, that I each time get a "back up with warnings" and then I should look at the logs if it's only those etc-permissions, or if there is a more serious problem. And since I'm no programmer, a lot of what's in the logs is comprehensible for me. |
Beta Was this translation helpful? Give feedback.
-
I just recently started using borg to do remote backups of my homelab, and discovered Vorta, and was pretty excited to have a super slick/easy/fast way for me and my family to backup our desktops/laptops as well, then I ran into this problem... So, to summarize the thread I've read so far (for the convenience of any that come after me): If you want to backup any files that aren't readable by the user you're running the Vorta GUI as, you should probably choose a different backup GUI/solution (BackInTime was mentioned). There are workarounds in this thread involving various ways to run Vorta or borg as root, but they're all kludges creating various security and convenience issues, and the Vorta maintainer doesn't really think this is a problem worth fixing, or at least doesn't see an easy way to fix it. Please correct me if that summary isn't accurate. |
Beta Was this translation helpful? Give feedback.
-
TL;DR: I offer another use case for Vorta with full-disk/root access: OS X users who want to back up all of their files, and are tired of fighting with OS X full disk access restrictions. This alone was a big selling point for me to try out Vorta. More blah-blah from me: I have been using a custom shell script to run Borg backup for years now. It's "OK", with caveats:
Vorta is so close to what I need! I hope the root access thing can get a nice, elegant solution that fits with the GUI. Great work so far! If you fine people decide against root access, I'll be sad, and go back to hacking my sad shell script. |
Beta Was this translation helpful? Give feedback.
-
I usually run Vorta as a user. However for a complete backup of e.g. the
/etc
files, I think, it will be necessary to run Vorta asroot
.My wish and suggestion is that you describe the best way to perform such backups in your description or readme.
Beta Was this translation helpful? Give feedback.
All reactions