Skip to main content

Files downloaded from FileZilla have "-????????? ? ? ? ?" permissions and I can't cho [Resolved]

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 : 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?


Question Credit: Zhro
Question Reference
Asked September 19, 2019
Posted Under: Unix Linux
17 views
1 Answers

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?


credit: ilkkachu
Answered September 19, 2019
Your Answer