我有一台运行 vsftpd 的 Ubuntu 18 LTS 服务器。一些用户可以毫无问题地使用 ftp 服务,但有一位用户在尝试连接服务器时始终收到错误。出现问题的用户是从 Windows 计算机连接的,并弹出一个提示
An error occurred opening that folder on the FTP Server.
Make sure you have permission to access that folder.
Details:
200 Switching to ASCII mode.
227 Entering Passive Mode (172,31,85,112,156,101).
我使用的是 MacBook Pro,可以毫无问题地连接到他尝试使用的同一帐户。连接后,我可以使用两个不同的 ftp 应用程序(FileZilla 和 Cyberduck)上传文件、下载文件和删除文件。
以下是 vsftpd.conf 文件中未注释的行。
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=013
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=NO
log_ftp_protocol=YES
async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
chroot_list_enable=NO
allow_writeable_chroot=YES
ls_recurse_enable=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
max_clients=20
max_per_ip=4
pasv_enable=YES
pasv_max_port=40100
pasv_min_port=40000
我打开了服务器上的日志,下面是他尝试连接时我看到的内容。我已将 IP 地址更改为“XXX.XXX.XXX.XXX”,将用户名更改为“ftpuser”,但其余内容与日志中的内容完全相同。
Tue Apr 28 15:25:45 2020 [pid 14174] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "USER ftpuser"
Tue Apr 28 15:25:45 2020 [pid 14174] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "331 Please specify the password."
Tue Apr 28 15:25:45 2020 [pid 14174] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PASS <password>"
Tue Apr 28 15:25:45 2020 [pid 14173] [ftpuser] OK LOGIN: Client "::ffff:XXX.XXX.XXX.XXX"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "230 Login successful."
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "OPTS utf8 on"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "200 Always in UTF8 mode."
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "SYST"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "215 UNIX Type: L8"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "SITE help"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "214 CHMOD UMASK HELP"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PWD"
Tue Apr 28 15:25:46 2020 [pid 14175] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "257 "/" is the current directory"
Tue Apr 28 15:25:46 2020 [pid 14177] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "USER ftpuser"
Tue Apr 28 15:25:46 2020 [pid 14177] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "331 Please specify the password."
Tue Apr 28 15:25:46 2020 [pid 14177] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PASS <password>"
Tue Apr 28 15:25:46 2020 [pid 14176] [ftpuser] OK LOGIN: Client "::ffff:XXX.XXX.XXX.XXX"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "230 Login successful."
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "OPTS utf8 on"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "200 Always in UTF8 mode."
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "SYST"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "215 UNIX Type: L8"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "SITE help"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "214 CHMOD UMASK HELP"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PWD"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "257 "/" is the current directory"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "TYPE A"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "200 Switching to ASCII mode."
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PASV"
Tue Apr 28 15:25:46 2020 [pid 14178] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "227 Entering Passive Mode (172,31,85,112,156,84)."
Tue Apr 28 15:25:46 2020 [pid 14180] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "USER ftpuser"
Tue Apr 28 15:25:46 2020 [pid 14180] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "331 Please specify the password."
Tue Apr 28 15:25:46 2020 [pid 14180] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PASS <password>"
Tue Apr 28 15:25:46 2020 [pid 14179] [ftpuser] OK LOGIN: Client "::ffff:XXX.XXX.XXX.XXX"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "230 Login successful."
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "OPTS utf8 on"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "200 Always in UTF8 mode."
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PWD"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "257 "/" is the current directory"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "TYPE A"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "200 Switching to ASCII mode."
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP command: Client "::ffff:XXX.XXX.XXX.XXX", "PASV"
Tue Apr 28 15:25:46 2020 [pid 14181] [ftpuser] FTP response: Client "::ffff:XXX.XXX.XXX.XXX", "227 Entering Passive Mode (172,31,85,112,156,66)."
我已经尝试了很多方法,比如打开asnyc_abor_enable
、启用 ASCII 下载和上传,以及设置ls_recurse_enable
为 YES。这些方法都没有用,而且我无法在我的环境中重现这个问题,所以我已经没有主意了。
对于可能导致该问题的原因您有什么想法吗?或者还有其他解决方法吗?