我按照网络搜索到的说明设置了vsftpd
服务器,一切正常,直到我尝试保护它。
我检查了所有目录名称,并多次编辑、卸载、重新安装服务器。我允许访问所有端口,确保只有 root 是文件的所有者.conf
,授予我对家庭网络上目录的用户权限,并将其添加到用户列表文件中,现在我束手无策了。
我似乎得到的错误是code=exited, status=2
。如果我遗漏了什么,请提前致歉,但以下是我的文件:
端口:
To Action From
-- ------ ----
Apache ALLOW Anywhere
20/tcp ALLOW Anywhere
21/tcp ALLOW Anywhere
20:21/tcp ALLOW Anywhere
30000:31000/tcp ALLOW Anywhere
OpenSSH ALLOW Anywhere
990 ALLOW Anywhere
Apache (v6) ALLOW Anywhere (v6)
20/tcp (v6) ALLOW Anywhere (v6)
21/tcp (v6) ALLOW Anywhere (v6)
20:21/tcp (v6) ALLOW Anywhere (v6)
30000:31000/tcp (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
990 (v6) ALLOW Anywhere (v6)
我的/etc/vsftpd.conf
文件:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
user_sub_token=$USER
local_root=/home/$USER/ftp
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=31000
pasv_address=127.0.0.1
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
userlist_deny=NO
答案1
这是适合我的设置。
listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=002
dirmessage_enable=YES
use_localtime=YES
connect_from_port_20=YES
idle_session_timeout=600
data_connection_timeout=120
ftpd_banner=Welcome to FTP service.
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
pam_service_name=vsftpd
ssl_enable=NO
utf8_filesystem=YES
allow_writeable_chroot=YES