linuxftpcentos7vsftpd

Can only see directories but no file in ftp (using VSFTPD)


I deploy a ftp server using VSFTPD, and trying to connect with it.
Then something weird appears, I can only see directories but no file.
I tried it using all kinds of my different physical machine and ftp client app, but it doesn't work.
For example, it is what I seen in ftp client:

ftp> ls
227 Entering Passive Mode (***,**,***,**,34,193).
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Jun 22 18:51 __pycache__
drwxr-xr-x    2 0        0            4096 Jun 22 18:47 config
drwxr-xr-x    5 0        0            4096 Jun 19 01:04 cores
drwxr-xr-x    4 0        0            4096 Jun 12 18:50 data
drwxr-xr-x    3 0        0            4096 Jun 22 20:34 gcores
drwxr-xr-x    4 0        0            4096 Jun 22 20:34 pcores
drwxr-xr-x    4 0        0            4096 Jun 22 18:40 runtime-data
226 Directory send OK.

and it's what really in this folder:

[root@** botscript]# ll
total 112
drwxr-xr-x. 2 root root  4096 Jun 23 02:47 config
drwxr-xr-x. 5 root root  4096 Jun 19 09:04 cores
drwxr-xr-x. 4 root root  4096 Jun 13 02:50 data
drwxr-xr-x. 3 root root  4096 Jun 23 04:34 gcores
-rwxrwxrwx. 1 root root 35129 Jun 13 02:38 LICENSE
-rw-r--r--. 1 root root   785 Jun 23 02:42 main.py
-rw-r--r--. 1 root root  6389 Jun 23 02:51 mirai_server.py
-rw-r--r--. 1 root root  7077 Jun 21 06:58 mirai_server.pyc
drwxr-xr-x. 4 root root  4096 Jun 23 04:34 pcores
drwxr-xr-x. 2 root root  4096 Jun 23 02:51 __pycache__
-rw-r--r--. 1 root root  1306 Jun 23 02:19 README.md
-rw-r--r--. 1 root root   117 Jun 21 20:01 requirements.txt
drwxr-xr-x. 4 root root  4096 Jun 23 02:40 runtime-data
-rw-r--r--. 1 root root   371 Jun 13 03:49 update.py
-rw-r--r--. 1 root root 13906 Jun 21 01:37 web_api.py

Notice that LICENSE is in mod rwxrwxrwx, but it can't be seen either.
However, if I use SFTP instead of FTP, it will be fine.
Is it anything wrong with VSFTP? I didn't change any config of it, except of user list(allowing root user) and pasv port(8888-8899).

Firewall: disabled; CentOS: CentOS Linux release 7.9.2009 (Core); VSFTPD: vsFTPd 3.0.2


Solution

  • Oh! I found what's wrong.
    I'm using SELinux, so it block some of ftp access.
    I just need to shut it down.