I'm having issue with my vsftpd
.
here is my info:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.0 (Maipo)
# uname -a
Linux ip-10-150-53-42.ec2.internal 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
# rpm -q vsftpd
vsftpd-3.0.2-9.el7.x86_64
# ll -d /usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS
drwxr-xr-x. 2 root root 98 Jun 13 20:33 /usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS
# grep -v ^# /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd.pam
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
local_root=/var/www/html/$USER
user_sub_token=$USER
hide_ids=YES
nopriv_user=apache
virtual_use_local_privs=YES
log_ftp_protocol=YES
xferlog_std_format=YES
syslog_enable=YES
# getsebool ftp_home_dir
ftp_home_dir --> on
#
I'm trying to utilize virtual users feature inside of vsftpd
and while authentication part works without any issues, unfortunately write
doesn't work.
# ls -ld /var/www/html/
drwxr-xr-x. 5 root root 71 Jun 14 13:45 /var/www/html/
# ls -ld /var/www/html/test/
drwxrwxr-x. 2 apache apache 30 Jun 14 14:45 /var/www/html/test/
# cd /etc/
# ftp 0
Connected to 0 (0.0.0.0).
220 (vsFTPd 3.0.2)
Name (0:root): test
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> put fstab
local: fstab remote: fstab
227 Entering Passive Mode (127,0,0,1,202,176).
553 Could not create file.
ftp> 221 Goodbye.
#
I've tried to disabling(permissive) and enabling(enforcing) SELinux and still same undesirable result(
What am I missing?
Best Answer
I'm not sure why (perhaps a bug?), even though
nopriv_user
was set toapache
, somehowvsftpd
was thinking it set toftp
:... yet when I upload file it's like
nopriv_user
is set toftp
:So, unless I'm doing something wrong, maybe I should submit it to
vsftpd
as bug.