我有一个 FTP 用户,其默认用户是 /root/ftpuser
该用户可以正常登录。该用户是目录的所有者,并且目录甚至设置为 777 权限。
但用户无法上传任何内容,显示为:
Status: Connecting to xx.xxx.xxx.xx:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 2 of 50 allowed.
Response: 220-Local time is now 05:12. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220-IPv6 connections are also welcome on this server.
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER ftpuser
Response: 331 User ftpuser OK. Password required
Command: PASS *********
Response: 230 OK. Current restricted directory is /
Command: OPTS UTF8 ON
Response: 200 OK, UTF-8 enabled
Status: Connected
Status: Starting upload of test.html
Command: CWD /
Response: 550 Can't change directory to /: Permission denied
Command: MKD /
Response: 550 Can't create directory: Permission denied
Command: CWD /
Response: 550 Can't change directory to /: Permission denied
Command: SIZE /btn.png
Response: 550 Can't check for file existence
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (66,232,106,33,52,218)
Command: STOR /test.html
Response: 553 Can't open that file: Permission denied
Error: Critical file transfer error
它是一个 Linux CentOS 6 服务器。
有任何想法吗?
答案1
不幸的是,您没有给我们太多信息。我猜 selinux 已启用。尝试运行 sestatus 并亲自查看 selinux 指令是否被强制执行。如果是,您将必须相应地切换 selinux 变量。
答案2
我遇到了同样的问题。编辑/etc/vsftpd.conf
并更改了以下内容:
write_enabled=YES
然后就成功了。
答案3
从给出的细节,我只能想到。
Turn iptables off.
Disable selinux.
它可能会有帮助。
此外,由于缺乏足够的细节和知识,我想知道为什么任何人都需要有 ftp 路径/root/ftpuser
。
答案4
如果你编辑/etc/vsftpd.conf
并设置:write_enabled=YES
但仍然不起作用,则需要重新启动服务
$sudo service vsftpd restart