I have a directory on my Linux (CentOS) server which serves as a repository for uploaded files from a webpage.

I noticed I was not able to open the file using Filezilla via FTP (was formerly able to), so I logged in using root access via shell and tried to change the directory to the one in quesiton - the cd command was succesful (the prmpt listed the directory) but the dir command resulted in noresponse (no error, just a new prompt with nothing else returned).

Thinking that it was an empty directory (maybe no users had uploaded anything) I uploaded a file myself, tried dir again - nothing.

So then I searched for the file that was uploaded using

find / -type f -name myfile.xlsx

And the location was returned as the inaccessible directory!

I'm now out of of ideas (not very experienced with shell / bash type access) - but it seems the file(s) are in there, any ideas how I could retrieve them / open the files?

EDIT: The FTP log for attempting to access the file is as follows

Status: Directory listing of "/public_html/uploads" successful
Status: Retrieving directory listing of "/public_html/uploads/offlinexls"...
Command:    CWD /public_html/uploads/offlinexls
Response:   550 /public_html/uploads/offlinexls: No such file or directory
Error:  Failed to retrieve directory listing

the permissions on the directory is set at 777

The FTP user has access to all files and folders

  • Check file permissions (for the ftp user) and log files as per documentation of the FTP server you use. – Steven Jul 2 '15 at 21:08
  • Have edited my post to reflect this – Gideon Jul 2 '15 at 22:14
  • do ls -l foldername from outside of the folder – td512 Jul 2 '15 at 22:29

Plain and Simple, you can eXecute the folder, but you aren't able to Read the folder. all you have to do is set permissions to 0775 or:

User: rwx, Read, Write, Execute

Group: rwx, Read, Write, Execute

Other: rx, Read, Execute

i.e.: rwxrwxr-x is what should show up on the folder after listing the parent directory with ls -a and after applying permissions 0755 on that folder

  • Hmm, tried this, also went hole hog and changed them to -777 I can now open the file in FTP but it's empty. Never the less my find is still finding my uploaded file in that directory? – Gideon Jul 2 '15 at 23:13
  • @Gideon mind marking my answer as the solution? – td512 Jul 2 '15 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.