Objective:
I am trying to create a simple sftp access to the /var/www/ directory.
My Problem:
When I login via ftp, although I get access to the /var/www/ -I have access to the root directory also. I changed the chroot option as mentioned below to YES but still the problem persists. I cant seem to restrict access just to the /var/www folder.
Any help is appreciated.
Environment
- CentOS7
Config
Below is my /etc/vsftpd/vsftpd.conf file
I created the user like so;
sudo useradd -m ftpuser -d /var/www/ sudo passwd ftpuser With the config file below, I have tried both with
chroot_local_user=YES and
chroot_local_user=NO VSFTPD Conf file
local_enable=YES write_enable=YES local_umask=022 allow_ftpd_full_access dirmessage_enable=YES xferlog_enable=YES xferlog_std_format=YES connect_from_port_20=YES userlist_enable=YES chroot_local_user=YES listen=NO listen_ipv6=YES pam_service_name=vsftpd tcp_wrappers=YES ssl_enable=YES rsa_cert_file=/etc/path_to_my_cert.pem rsa_private_key_file=/etc/path_to_my_keyv.pem
sudo systemctl restart vsftpd