0

I download some files through FileZilla and all of the files in subdirectories have this "???" owner/group permision:

-????????? ? ? ? ?            ? file_a.txt
-????????? ? ? ? ?            ? file_b.txt
-????????? ? ? ? ?            ? file_c.txt

This is when viewed from "user_a" but when viewed as root then are correctly identified at "user_a:user_a". I tried to chown -R <owner>:<group> path/ but permissions still look correct as root and still look like "???" on "user_a".

I tried copying the folder and fixing the permissions but it's still messed up. How can I fix this?

1 Answer 1

2

You didn't show the permissions of the directory containing those files, but it's likely you're missing the access (x) bit from the directory permissions. Without it, you can't call stat() on files, and thus can't find out their sizes, permissions, owners, etc.

Example:

$ mkdir dir; touch dir/foo.txt; chmod -x dir; ls -l dir
ls: cannot access 'dir/foo.txt': Permission denied
total 0
-????????? ? ? ? ?            ? foo.txt

Make sure you have the x bit set on the directories. You could add it for the owner for all directories in the subtree with something like this:

find . -type d -exec chmod u+x {} +

See: Execute vs Read bit. How do directory permissions in Linux work?

3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .