vsftpd 错误列出目录

发布于 2024-10-13 00:56:48 字数 524 浏览 3 评论 0原文

我在 amazon ec2 上使用 fedora 实例安装了 vsftpd,它是最新版本,但我收到错误: 在 CuteFTP 中:

COMMAND:> PASV 227 Entering Passive Mode (192,168,10,46,14,20)
COMMAND:> LIST
ERROR:> Can’t connect to remote server. Socket error = #10065.
ERROR:> PASV failed, trying PORT.

在 Filezilla 中:

Command: PASV Response: 227 Entering Passive Mode (192,168,10,46,14,20)
Command: LIST Error: Connection timed out
Error: Failed to retrieve directory listing.

尝试通过 Shell 连接并显示目录列表。

I installed vsftpd on amazon ec2 with fedora instance and it is the latest version but I am getting the error:
In CuteFTP:

COMMAND:> PASV 227 Entering Passive Mode (192,168,10,46,14,20)
COMMAND:> LIST
ERROR:> Can’t connect to remote server. Socket error = #10065.
ERROR:> PASV failed, trying PORT.

In Filezilla:

Command: PASV Response: 227 Entering Passive Mode (192,168,10,46,14,20)
Command: LIST Error: Connection timed out
Error: Failed to retrieve directory listing.

Trying to Connect thro' Shell and showing me list of directories.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

走过海棠暮 2024-10-20 00:56:48

刚刚遇到了同样的问题...这通常只影响使用被动模式(这很常见)的 GUI ftp 客户端。例如,当使用标准 ftp 命令行工具时,我能够成功登录并将文件上传到我的 ftp 服务器。

更正步骤是:

  1. 将以下设置添加到 /etc/vsftpd.conf 文件中:

    pasv_enable=YES
    pasv_min_port=64000
    pasv_max_port=64321
    port_enable=YES

  2. 还可以根据您的情况将以下配置块之一添加到 /etc/vsftpd.conf 文件中(无论哪种方式,都需要解析为公共可访问的 IP):

a:

pasv_address=<your-static-ip-most-likely-from-elastic-ips>
pasv_addr_resolve=NO

-OR-

b :

pasv_address=<your-publicly-resolvable-host-name>
pasv_addr_resolve=YES
  1. 在 ec2 实例的安全组配置中,添加以下自定义入站 tcp 规则:
  • 为标准 ftp 启用端口 20-21
  • 启用上面配置部分中定义的被动端口(我使用 64000-64321)
  1. 重新启动 vsftpd 服务(因情况而异)取决于您的 Linux 风格)

注意:pasv 端口范围应该在防火墙外部可见,NAT

参考以获取更多信息:

Just had this same exact issue... this typically only affects GUI ftp clients that use a passive mode (which is pretty common). For instance, when using the standard ftp command line tool, I was able to successfully login and upload files to my ftp server.

The steps to correct are:

  1. Add the following settings to your /etc/vsftpd.conf file:

    pasv_enable=YES
    pasv_min_port=64000
    pasv_max_port=64321
    port_enable=YES

  2. Also add one of the following config chunks to your /etc/vsftpd.conf file, based on your situation (either way, this needs to resolve to a public accessible IP):

a:

pasv_address=<your-static-ip-most-likely-from-elastic-ips>
pasv_addr_resolve=NO

-OR-

b:

pasv_address=<your-publicly-resolvable-host-name>
pasv_addr_resolve=YES
  1. In your security group configuration for ec2 instances, add the following custom inbound tcp rules:
  • Enable ports 20-21 for standard ftp
  • Enable your passive ports as defined in the config sections above (I used 64000-64321)
  1. Restart your vsftpd service (varies depending on your flavor of linux)

Note: pasv port range should be visible outside from the firewall, NAT

References for more info:

江湖正好 2024-10-20 00:56:48

只需将传输模式更改为活动即可修复亚马逊 ec2 上的错误:无法检索目录列表

这篇文章解释了如何使用 filezilla 轻松完成此操作:

https://nabtron.com/error-while-connecting-to-amazon-ec2-via-ftp-solution/

error: failed to retrieve directory listing on amazon ec2 can be fixed by simply changing transfer mode to active.

this post explains how to get it done easily using filezilla:

https://nabtron.com/error-while-connecting-to-amazon-ec2-via-ftp-solution/

勿忘初心 2024-10-20 00:56:48

使用版本 vsftpd-3.0.2-1.el5.x86_64.rpm 对我来说帮助了以下设置:

pasv_enable=YES
pasv_min_port=64000
pasv_max_port=64321
port_enable=YES
pasv_address=<your-static-ip-most-likely-from-elastic-ips>
pasv_addr_resolve=NO

感谢longda!

With version vsftpd-3.0.2-1.el5.x86_64.rpm for me helped the following settings:

pasv_enable=YES
pasv_min_port=64000
pasv_max_port=64321
port_enable=YES
pasv_address=<your-static-ip-most-likely-from-elastic-ips>
pasv_addr_resolve=NO

Thanks to the longda!

白馒头 2024-10-20 00:56:48

这对我有用;

以下是 /etc/vsftpd.conf 中的配置

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_local_user=YES
allow_writeable_chroot=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=ftp
pasv_enable=YES
pasv_min_port=13000
pasv_max_port=13100
port_enable=YES
pasv_address=AWS-IP-Address
pasv_addr_resolve=no

保存并重新启动服务

$ sudo service vsftpd restart

在安全组中打开以下端口

  • 自定义 TCP 20 from 0.0.0.0/0
  • 自定义 TCP 21 from 0.0。 0.0/0
  • 自定义 TCP 13000 来自 0.0.0.0/0
  • 自定义 TCP 13100 来自 0.0.0.0/0

从 FileZilla FTP 客户端连接时,您可能会收到以下错误;

Error:  Connection timed out
Error:  Failed to retrieve directory listing

为了解决这个问题;

  • 打开Filezilla,进入编辑->设置
  • 点击连接-> FTP:选择“活动”
  • ,单击“连接”-> FTP->活动模式:选择“询问您的操作
    系统的外部 IP 地址”
  • 点击连接 -> FTP -> 被动模式:选择回退到
    活动模式 按确定。

尝试再次连接到您的 FTP 站点。

This work for me;

Below is configuration in /etc/vsftpd.conf

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=YES
chroot_local_user=YES
allow_writeable_chroot=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=ftp
pasv_enable=YES
pasv_min_port=13000
pasv_max_port=13100
port_enable=YES
pasv_address=AWS-IP-Address
pasv_addr_resolve=no

SAVE and Restart the service

$ sudo service vsftpd restart

Open below ports in security group

  • custom TCP 20 from 0.0.0.0/0
  • custom TCP 21 from 0.0.0.0/0
  • custom TCP 13000 from 0.0.0.0/0
  • custom TCP 13100 from 0.0.0.0/0

You may get below error while connecting from FileZilla FTP client;

Error:  Connection timed out
Error:  Failed to retrieve directory listing

To resolve this;

  • Open Filezilla, go to Edit -> Settings
  • Click on Connection -> FTP: Choose Active
  • Click on Connection -> FTP -> Active Mode: Select "Ask your operating
    system for the external IP address"
  • Click on Connection -> FTP -> Passive Mode: Choose Fall Back to
    Active Mode Press OK.

Try connecting to your FTP site once again.

白馒头 2024-10-20 00:56:48

如果可能的话,您希望使用被动模式。正如我在 Bucho 链接的文章中所说,您只需定义 PASV 模式的端口范围并在 EC2 安全组中打开该范围

You want to use passive mode if possible. As I said in the article Bucho linked to, you just have to define a port range for PASV mode and open that range in your EC2 security group

微暖i 2024-10-20 00:56:48

如果 vsftpd.conf 中有如下配置:

pasv_enable=YES
pasv_min_port=64000
pasv_max_port=64321

尝试打开防火墙:

# yum install -y epel-release
# yum install -y ufw
# sudo ufw allow from any to any proto tcp port 64000:64321

sudo iptables -A INPUT -p tcp –dport 64000:64321 -j ACCEPT

if some configuration like below in vsftpd.conf:

pasv_enable=YES
pasv_min_port=64000
pasv_max_port=64321

try to open firewall:

# yum install -y epel-release
# yum install -y ufw
# sudo ufw allow from any to any proto tcp port 64000:64321

sudo iptables -A INPUT -p tcp –dport 64000:64321 -j ACCEPT
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文