vsftpd:550 尝试上传/写入文件的权限被拒绝

vsftpd:550 尝试上传/写入文件的权限被拒绝

我创建了一个用户 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 上)

难道我做错了什么?我正在寻找的东西可行吗?

答案1

最后我找到了一个方法:

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

相关内容