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=NOlisten_ipv6=YESanonymous_enable=NOlocal_enable=YESwrite_enable=YESdirmessage_enable=YESuse_localtime=YESxferlog_enable=YESconnect_from_port_20=YESchroot_local_user=YESlocal_root=/var/www/htmlsecure_chroot_dir=/var/run/vsftpd/emptypam_service_name=vsftpdrsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pemrsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.keyssl_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?