已设置FTP服务器和用户。但我似乎无法上传或编辑任何文件。
即使用户已经填写了777权限。我什至无法将文件上传到用户的根文件夹。
服务器操作系统:Ubuntu
客户端操作系统窗口
FTP 服务器/客户端:fileZila
日志:
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting upload of C:\Users\User\AppData\Local\Temp\fz3temp-2\single-product.php
Command: PASV
Response: 227 Entering Passive Mode (165,227,173,119,117,244).
Command: STOR single-product.php
Response: 550 Permission denied.
Error: Critical file transfer error
文件权限:
组和用户:
vsftpd.conf:
# Standalone mode
listen=YES
max_clients=200
max_per_ip=4
# Access rights
anonymous_enable=YES
local_enable=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
# Security
anon_world_readable_only=NO
connect_from_port_20=YES
hide_ids=YES
pasv_min_port=50000
pasv_max_port=60000
# Features
xferlog_enable=YES
ls_recurse_enable=NO
ascii_download_enable=NO
async_abor_enable=YES
# Performance
one_process_model=YES
idle_session_timeout=120
data_connection_timeout=300
accept_timeout=60
connect_timeout=60
anon_max_rate=50000
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
#Userlist
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd.allowed_users
vsftpd.allowed_users:
ftpuser
知道这是怎么回事吗?
更新:我已将保存该文件的文件夹的权限更改为777,但仍然不起作用。
日志:
Status: Logged in
Status: Starting download of /var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper/woocommerce/single-product.php
Status: File transfer successful, transferred 1,193 bytes in 1 second
Status: Starting upload of C:\Users\User\AppData\Local\Temp\fz3temp-2\single-product.php
Command: PASV
Response: 227 Entering Passive Mode (*xxxxxxxxxxxx*).
Command: STOR single-product.php
Response: 550 Permission denied.
Error: Critical file transfer error
Status: Retrieving directory listing of "/var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper"...
Status: Directory listing of "/var/www/html/wp/staged/wp-content/themes/Newspaper/Newspaper" successful
Status: Disconnected from server
Status: Connection closed by server
答案1
您的服务器似乎已经完全开放。你有过
anonymous_enable=YES
local_enable=NO
ftp
因此任何人都可以使用用户名或来连接到 FTP 服务器,而无需进行真正的密码检查,并访问配置为(未指定,默认为)anonymous
的用户帐户可以访问的任何文件或目录。此类匿名登录也比常规的密码验证登录受到更严格的控制。ftp_username
ftp
上传可能失败,因为vsftpd
可能不允许匿名用户覆盖现有文件:我认为您必须明确删除或重命名旧文件,然后才能以匿名用户身份上传新文件。但因为你有过
anon_other_write_enable=NO
它不会允许你这样做。
如果您使用 FTP 服务器来允许网站维护,那么您肯定需要设置anonymous_enable
为“否”和local_enable
“是”,以禁止未经身份验证的访问,否则任何拥有 FTP 客户端的人都可以轻松破坏您的网站。
(并且不加密的身份验证是所以上个世纪:您可能希望通过 TLS 设置 FTP,除非您仅允许从安全专用网络进行 FTP 访问!)