只能在FTP中看到目录,但没有文件(使用VSFTPD)
我使用VSFTPD部署了FTP服务器,并尝试与之连接。
然后出现一些奇怪的东西,我只能看到目录,但没有文件。
我使用各种不同的物理机器和FTP客户端应用程序尝试了它,但它不起作用。
例如,这是我在FTP客户端中看到的内容:
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.
这就是该文件夹中的真正内容:
[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
请注意,许可证在mod rwxrwxrwx中,但也看不见。
但是,如果我使用SFTP代替FTP,那会没关系。
VSFTP有什么问题吗?除了用户列表(允许root用户)和PASV端口(8888-8899)之外,我没有更改其任何配置。
防火墙:禁用; CentOS:CentOS Linux版本7.9.2009(Core); VSFTPD:VSFTPD 3.0.2
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
哦!我发现有什么问题。
我正在使用selinux,所以它阻止了一些FTP访问。
我只需要关闭它。
Oh! I found what's wrong.
I'm using SELinux, so it block some of ftp access.
I just need to shut it down.