Ownership of files

So while working to find out the vetting status of my nodes that I’m running under Raspberry Pi OS, I discovered that my file ownership might be incorrect. I had to use sudo to get the earnings calculator to work. Checking one of my node paths I see that they’re owned by root, which explains the need for sudo. Is this expected? Should I push a chown through the paths and update them to pi:pi or just leave these as is?

pi@storjpi:~ $ ls -l /mnt/storj1/storagenode1
total 60
-rw------- 1 root root  8447 Nov 12 03:25 config.yaml
drwxr-xr-x 2 pi   pi    4096 Feb 17 23:47 identity
drwx------ 4 root root  4096 Nov 12 03:25 orders
-rw------- 1 root root 32768 Apr  3 19:21 revocations.db
drwx------ 6 root root  4096 Apr  5 15:21 storage
-rw------- 1 root root  1420 Apr  5 12:48 trust-cache.json
pi@storjpi:~ $

Depends who writes these files.
Although it might not be the best set-up (according to some), docker only works under root by default.
So if you’re starting your node with something like “sudo docker …” then your node’s stored files belong to root.

If everything’s working fine, and if you don’t mind the node working under root, I wouldn’t change anything.

Don’t fix what’s not broken! :slight_smile:

4 Likes

Yeah, I don’t use sudo with the docker commands, although I may have done so on the setup of the nodes. I seem to recall something about adding the pi user to a group or something so sudo wasn’t needed for docker but I can’t find it in any of the documentation I remember referencing. When I first set up I know I was in the alpha documentation at one point so maybe it was there.

Nodes are working fine, I’m just finding that for some tasks (like using the earnings calculator) I need sudo. I was only using the calc to check vetting status (1st node 100%, nodes 2 and 3 on their way) so no big deal to leave it alone I guess.

According to the third party doctrine, you own the files you host, as the customers willingly gave you them for storage.

(sorry, couldn’t resist ;-))

You should be very clear on what user does & owns what. If some of your files are owned by root but some Storj processes aren’t running as root, you’re likely to face some issues at some points. It would be a shame to get disqualified because some files saved as root can’t be accessed by the Node process.

I would be very surprised if your nodes weren’t running as root, as they would not be able to access config.yaml, orders/, revocations.db

If nothing seems wrong with your bandwidth usage and scores, then I guess your setup is fine. I would simply recommend making it clear why some files are owned by root, what process are supposed to access them, what user is running Storj nodes… to avoid potential unpleasant surprises later on ^^

I had issues with permissions before and it was a nightmare, but it was on data files.