Unable to view contents of directory on Linux server via FTP, or using "dir" via shell, able to find files within directory nonetheless

1

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

Gideon

Posted 2015-07-02T21:01:46.213

Reputation: 125

Check file permissions (for the ftp user) and log files as per documentation of the FTP server you use. – Steven – 2015-07-02T21:08:54.537

Have edited my post to reflect this – Gideon – 2015-07-02T22:14:08.380

do ls -l foldername from outside of the folder – td512 – 2015-07-02T22:29:01.610

Answers

1

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

td512

Posted 2015-07-02T21:01:46.213

Reputation: 4 778

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 – 2015-07-02T23:13:16.333

@Gideon mind marking my answer as the solution? – td512 – 2015-07-02T23:22:48.700