0

I use sudo su to become root and run a (borg) backup on a filesystem mounted at /mnt. Some of the directories and files have permissions 0600 and I receive permission denied when trying to read a file.

I had the (obviously wrong) understanding, that the user root can read all files, independent of the specific protection and that after sudo su the process runs as root.

What is the correct understanding? I have seen answers to similar questions, but do not understand the principles.

Practically: what protection must I set to make directories and files readable to a process running with under sudo su?

user855443
  • 135
  • 6
  • Are you packing up *to* `/mnt`, or *from* `/mnt`? Are these errors occuring for `/proc`? – Panki Aug 13 '21 at 12:54
  • 3
    Is it NFS-mounted? NFS has extra rules to allow / deny root privileges. – hymie Aug 13 '21 at 13:02
  • I read from /mnt. borg mounts with FUSE (of which I do not know much). – user855443 Aug 13 '21 at 13:26
  • Thanks for the pointer, but as I reconsider what I did, I found that in this case I mounted with NFS. I tried to find an answer but could not see what applies to my case. – user855443 Aug 13 '21 at 14:53
  • 3
    As an aside, `sudo su` is unnecessary. It's like saying "Hello `sudo` please can I have root permissions to run the `su` command ... _yes ok_. Great. Hello `su`, I know we're already root but please make me root ... _uh ok_". Just use `sudo -s` – roaima Aug 13 '21 at 14:58
  • 1
    By default, root does not have root privileges on NFS-mounted directories. Look up the `no_root_squash` export option. – berndbausch Aug 14 '21 at 02:46

0 Answers0