Seems like this should be easy, but I'm really struggling here. I'm not well versed on Linux but I can get around. I just setup a new Ubuntu v20.04.2 Server
and installed Apache2
on it. I then installed VSFTPD
on it as well.
Now I'm trying to get it so when I login with user "remote" that I'm locked into the /var/www/html/ directory, but have write access to anything inside.
my vsftpd.conf
file has the following uncommented settings:
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
local_root=/var/www/html
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
When I set chown
on the /var/www/html
directory, now vsftpd refuses to connect because the root directory is writable. If I set it to default ownership (root) than I can't write to it when logged through FTP with the remote
login.
How do I get my remote
ftp login to have full access to the /var/www/html
directory, but only to that directory (and it's subdirectories), all while being secure?