已設定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 存取!