我有个问题。当我尝试连接ftp时,它给出这个错误。
/etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_umask=022
anon_upload_enable=NO
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
dual_log_enable=YES
chroot_local_user=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=NO
tcp_wrappers=YES
force_dot_files=YES
ascii_upload_enable=YES
ascii_download_enable=YES
allow_writeable_chroot=YES
seccomp_sandbox=NO
pasv_enable=YES
pasv_min_port=12000
pasv_max_port=12100
max_per_ip=10
max_clients=100
use_localtime=YES
pasv_address='35.195.69.80'FTP输出
Status: Connecting to 35.233.4.11:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is the current directory
Command: TYPE I
Response: 200 Switching to Binary mode.
Command: PASV
Response: 500 OOPS: invalid pasv_address
Command: PORT 192,168,1,34,199,3
Response: 500 OOPS: priv_sock_get_cmd
Error: Failed to retrieve directory listing
Error: Connection closed by serverFTP连接配置字段
host => packages.pastheme.com
Username => *****
Pass => *****我的操作系统ubuntu 16.04
发布于 2020-12-27 19:22:34
该问题可能与防火墙问题有关:命令端口(21)对业务开放,但被动传输模式端口被阻止。可以在here中找到一个很好的解释
在我的例子中,服务器位于ISP提供的额外“防火墙层”后面(例如AWS中的安全组)。因此,首先观察Vesta CP中被动传输模式的最小端口和最大端口:
pasv_enable=YES
pasv_max_port=12100
pasv_min_port=12000接下来,确保您为服务打开了此范围:

发布于 2019-02-07 00:35:28
服务器防火墙不允许向客户端发送数据,让它通过以下代码连接:
iptables -A INPUT -p tcp --dport 21 -j ACCEPT检查/etc/shells中是否注册了新用户路径。
nano /etc/shells如果没有,我很容易就添加了这一行:
/usr/sbin/nologin在所有重启相关服务后,请确保:
service iptables restart
service vsftpd restarthttps://stackoverflow.com/questions/51050012
复制相似问题