Linux permission denied issue with folder other than ~/Sync

If you get “permission denied” error on one of your files, in a custom folder, make sure to do the following:

chgrp -R youruser customfolder/
chown -R youruser customfolder/

youruser means your username other than root

then you are free from these kinda errors.

In details: I made the mistake of creating a folder with root user, than synced it.

I tried to resolve this issue for 2 or more hours, had to learn about permissions in linux a lot, and thats good, but i hate the fact that i didn’t solve it from google.

This is helpful info for people like me who should know better but are still learning after all these years.

My problem now is getting permission denied errors even though I have set group and owner to the syncthing user and group, and file permissions are 770. I even tried

chmod -R 777 *

and it still wants me to notice that permission is denied on some folders.

Just to be sure I ran setfacl -b -R * to make sure that there weren’t any ACLs interfering.

I think this started because there were some wonky default ACLs set on the parent directory, so syncthing was creating files that it then had no access to – they showed up with permissions ---r----- (040) even though syncthing had just created them.

Still haven’t solved this problem. I’ll post an update if/when I do.

Careful with the * as it doesn’t include hidden files or folders.

Wow, thanks for that – learn something new every day!

find . -exec setfacl -b '{}' \;

Does find all files, and at first appeared to clear all but one permission error.

I also realized that all these folders are coming from Android; not having checked “Ignore Permissions” might also have something to do with the problematic loss of sane/appropriate permissions.

However, I still haven’t been able to solve this. I think I will have to start from scratch and repopulate/sync the data.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.