File Permissions

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
flyg
Posts: 7
Joined: Fri Oct 30, 2020 4:14 pm

File Permissions

Post by flyg »

Hi

Not sure if I have messed up my permissions or not but a normal TV series these days ends up looking like the pic attached.

I have dietpi, plex, sonarr and root as owners of files and some with different read/write/execute perms.

What should it look like given all I do is let sonaar download my stuff via qbittorrent and let sonaar and plex rename files.

Any quick command that would go through and repair this?

thanks
Attachments
dpfiles.png
User avatar
trendy
Posts: 200
Joined: Tue Feb 25, 2020 2:54 pm

Re: File Permissions

Post by trendy »

One solution is to set the dietpi group as directory owner, then make all these users members of the dietpi group. Also you'd need to configure Sonarr to use the appropriate permissions when it creates a new file (660 for example).
User avatar
Joulinar
Posts: 3284
Joined: Sat Nov 16, 2019 12:49 am

Re: File Permissions

Post by Joulinar »

Yes exactly as @trendy described. All application user should be member of global user group dietpi and the group needs r/w access. This as well is DietPi standard. On a fresh installation, users should be added to global user group dietpi automatically.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
flyg
Posts: 7
Joined: Fri Oct 30, 2020 4:14 pm

Re: File Permissions

Post by flyg »

is there a command i can run now that will fix the permissions recursively? a return to default or something? i had a look at the group id thing and even though qbitrorent, sonaar, radaar etc were part of the same dietpi group i have files now that sonarr cant rename etc.

I'm not bothered about security of the device - its a stand alone unit - if there was a way to just give every user the ability to manipulate any other users files i would be happy with that as well.

thanls
User avatar
Joulinar
Posts: 3284
Joined: Sat Nov 16, 2019 12:49 am

Re: File Permissions

Post by Joulinar »

if you don't care on security, you can give permission 777 to all files and folder

Code: Select all

chmod -R 777 /path/to/your/folder
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 200
Joined: Tue Feb 25, 2020 2:54 pm

Re: File Permissions

Post by trendy »

First assign the root directory of your files to dietpi group.

Code: Select all

chgrp -R dietpi /mnt/path/ 
Then change the permissions in there.

Code: Select all

find /mnt/path -type d -print0 | xargs -0 chmod 2775
find /mnt/path -type f -print0 | xargs -0 chmod 664
Then make sure your -arr programs use the dietpi group when they add files, and that -arr users are in dietpi group.
Post Reply