vsftpd - 无法上传文件到服务器。错误553

8

我在EC2上安装和配置了vsftpd。读写功能在重启服务器之前都能正常工作。我检查了一些常见问题,例如chmod -R 777 /home/data_feedchown -R datafeed:ftpuser /home/data_feed。但是仍然无法向服务器写入。我收到的唯一错误信息是一个晦涩难懂的553错误。

ftp> put ~/Downloads/test.jpg
local: /Users/ram/Downloads/test.jpg remote: /Users/ram/Downloads/test.jpg
229 Entering Extended Passive Mode (|||12011|).
553 Could not create file.

这是配置文件:

ubuntu@******:~$ cat /etc/vsftpd.conf | grep -v ^#
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
nopriv_user=ubuntu
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
pasv_enable=YES
pasv_max_port=12100
pasv_min_port=12000
port_enable=YES
log_ftp_protocol=YES

以下是调试日志

Wed Sep 11 18:58:57 2013 [pid 2] CONNECT: Client "**.***.*.***"
Wed Sep 11 18:58:57 2013 [pid 2] FTP response: Client "**.***.*.***", "220 (vsFTPd 2.3.5)"
Wed Sep 11 18:58:57 2013 [pid 2] FTP command: Client "**.***.*.***", "USER savings_data_feed"
Wed Sep 11 18:58:57 2013 [pid 2] [data_feed] FTP response: Client "**.***.*.***", "331    Please specify the password."
Wed Sep 11 18:59:03 2013 [pid 2] [data_feed] FTP command: Client "**.***.*.***", "PASS <password>"
Wed Sep 11 18:59:03 2013 [pid 1] [data_feed] OK LOGIN: Client "**.***.*.***"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "230 Login successful."
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "SYST"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "215 UNIX Type: L8"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "FEAT"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "211-Features:"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " EPRT??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " EPSV??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " MDTM??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " PASV??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " REST STREAM??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " SIZE??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " TVFS??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", " UTF8??"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "211 End"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "PWD"
Wed Sep 11 18:59:03 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "257 "/home/data_feed""
Wed Sep 11 18:59:04 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "EPSV"
Wed Sep 11 18:59:04 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "229 Entering Extended Passive Mode (|||12081|)."
Wed Sep 11 18:59:05 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "LIST"
Wed Sep 11 18:59:05 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "150 Here comes the directory listing."
Wed Sep 11 18:59:05 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "226 Directory send OK."
Wed Sep 11 18:59:18 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "TYPE I"
Wed Sep 11 18:59:18 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "200 Switching to Binary mode."
Wed Sep 11 18:59:18 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "EPSV"
Wed Sep 11 18:59:18 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "229 Entering Extended Passive Mode (|||12011|)."
Wed Sep 11 18:59:19 2013 [pid 3] [data_feed] FTP command: Client "**.***.*.***", "STOR /Users/ram/Downloads/test.jpg"
Wed Sep 11 18:59:19 2013 [pid 3] [data_feed] FTP response: Client "**.***.*.***", "553 Could not create file."
Wed Sep 11 18:59:19 2013 [pid 3] [data_feed] FAIL UPLOAD: Client "**.***.*.***", "/Users/ram/Downloads/test.jpg", 0.00Kbyte/sec

感谢您的提前帮助。

无论你做什么,chmod 777 可能完全是错误的事情。从新备份中恢复? - tripleee
3个回答

18

您正在指定一个在远程服务器上不存在的完整路径。

ftp> put ~/Downloads/test.jpg
local: /Users/ram/Downloads/test.jpg
remote: /Users/ram/Downloads/test.jpg

看到了吗?你可能想要 lcd ~/Downloads 然后 put test.jpg,或者切换到一个允许你指定完整本地路径的客户端进行上传,并且仍然只使用远程文件名的基本名称。


6
setenforce 0
  • 检查 SELinux 是否启用

这真的应该是我启动新机器时首先要检查的事情,它总是让我感到困扰 :/ - Steffan Perry
你能再详细解释一下吗? :D - Campa

5

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接