FTP サーバーとユーザーを設定しました。しかし、ファイルをアップロードまたは編集できないようです。
ユーザーが 777 権限を付与しているにもかかわらず、ユーザーのルート フォルダーにファイルをアップロードすることすらできません。
サーバーOS: Ubuntu
クライアントOSウィンドウ
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 サーバーを使用して Web サイトのメンテナンスを行う場合は、認証されていないアクセスを禁止するために、必ずanonymous_enable
NO とlocal_enable
YES に設定する必要があります。そうしないと、FTP クライアントを持つユーザーが簡単にサイトを改ざんできるようになります。
(暗号化なしの認証はそれで前世紀: 安全なプライベート ネットワークからの FTP アクセスのみを許可しない限り、FTP over TLS を設定する必要があります。)
答え2
私は以下を使用して vsftpd をアンインストールしました:
sudo apt-get purge vsfpt
次に、この簡単なガイドを使用して設定します。 vsftpdの設定方法
何が問題だったのかまだわかりませんが、今は動作します。