Ftp

vsftpd:550 權限被拒絕嘗試上傳/寫入文件

  • April 22, 2020

我創建了一個使用者 jdoe,我想將這樣的使用者映射到 apache 使用者。所以每次我上傳一個文件都可能歸apache所有。

這是我的 /etc/vsftpd/vsftpd.conf 文件:

listen=YES
listen_ipv6=no
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
ls_recurse_enable=YES
pam_service_name=vsftpd
rsa_cert_file=/etc/vsftpd/www.example.com/fullchain1.pem
rsa_private_key_file= /etc/vsftpd/www.example.com/privkey1.pem
pasv_enable=Yes
pasv_min_port=1030
pasv_max_port=1035
ssl_enable=yes
debug_ssl=yes
force_local_logins_ssl=YES
force_local_data_ssl=YES
allow_anon_ssl=no
ssl_ciphers=HIGH
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
allow_writeable_chroot=YES
guest_enable=YES
chmod_enable=YES
chown_uploads=YES
chown_username=apache
guest_username=apache
hide_ids=YES
user_config_dir=/etc/vsftpd

我在 /etc/vsftpd/jdoe :

local_root=/var/www

但是當我上傳或創建一個文件時,我得到:

550 權限被拒絕

(在 Filezilla 上)

難道我做錯了什麼?我正在尋找的可行嗎?

最後我找到了一種方法:

listen=YES
listen_ipv6=no
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
log_ftp_protocol=YES
connect_from_port_20=YES
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
ls_recurse_enable=YES
pam_service_name=vsftpd
rsa_cert_file=/etc/vsftpd/www.example.com.ar/fullchain1.pem
rsa_private_key_file= /etc/vsftpd/www.example.com.ar/privkey1.pem
pasv_enable=Yes
pasv_min_port=1030
pasv_max_port=1035
ssl_enable=yes
debug_ssl=yes
force_local_logins_ssl=YES
force_local_data_ssl=YES
allow_anon_ssl=no
ssl_ciphers=HIGH
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
pasv_address=192.168.222.11
guest_enable=YES
chown_uploads=YES
chown_username=apache
guest_username=apache
hide_ids=YES
user_config_dir=/etc/vsftpd
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_umask=0002

並且:

/etc/vsftpd/jdoe

local_root=/var/www/www_example_com_ar

引用自:https://unix.stackexchange.com/questions/580832