我最近按照这个教程安装了 vsftpd:http://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/。我可以登录 ftp,但之后我从 FileZilla 获得以下结果:
Answer: 230 Login successful.
Commando: OPTS UTF8 ON
Answer: 200 Always in UTF8 mode.
Status: Connected
Status: Folder list
Commando: PWD
Answer: 257 "/"
Commando: TYPE I
Answer: 200 Switching to Binary mode.
Commando: PASV
Answer: 227 Entering Passive Mode (192,168,000,00,000,000). (I replaced the 0's)
Status: Server generated a passive answer with an untracable address. Uses the serveraddress instead
Commando: LIST
Error: Connection lost
Error: Receiving folder list failed
(以上内容我已经翻译)
我/etc/vsftpd.conf
有以下注释掉的行:
listen=YES
anonymouse_enable=NO
local_enable=YES
write_enable=YES
local_unmask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
chroot_local_user=YES (line #120)
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
allow_writeable_chroot=YES
ssl_ciphers=HIGH
pasv_enable=YES
pasv_max_port=40000
pasv_min_port=40100
我还将以下端口转发到服务器:
80 protocol both: TCP UDP
21 protocol both: TCP UDP
22 protocol both: TCP UDP
我也做了 22,因为我已经安装了 openssh
我希望有人能帮我弄清楚为什么我会收到这个错误信息。提前谢谢
答案1
您可能需要打开被动端口
iptables -I INPUT -p tcp --destination-port 40000:40100 -j ACCEPT
然后
service iptables save