In case you are using vsftpd
vi /etc/vsftpd.conf
force_local_data_ssl=NO
force_local_logins_ssl=YES
In case you are using vsftpd
vi /etc/vsftpd.conf
force_local_data_ssl=NO
force_local_logins_ssl=YES
pasv_enable=Yes
pasv_min_port=10100
pasv_max_port=10110
systemctl restart vsftpd
pasv_enable=YES
pasv_max_port=10100
pasv_min_port=10000
port_enable=YES
pasv_address=192.168.1.111
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20:21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10000:10100 -j ACCEPT
vsftpd read only user
apt-get update
apt-get install vsftpd libpam-pwdfile
cp -v /etc/vsftpd.conf /etc/vsftpd.conf.bak
vi /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
chroot_local_user=YES
user_config_dir=/etc/vsftpd/vsftpd-virtual-user/
virtual_use_local_privs=YES
dual_log_enable=YES
connect_from_port_20=YES
listen=YES
pam_service_name=ftp
tcp_wrappers=YES
allow_writeable_chroot=YES
service vsftpd restart
mkdir -p -v /etc/vsftpd/vsftpd-virtual-user/
cp -v /etc/pam.d/vsftpd /etc/pam.d/vsftpd.bak
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
session include system-auth
session required pam_loginuid.so
useradd --home /home/user --gid nogroup -m --shell /bin/false user
passwd user
echo user >> /etc/vsftpd/vsftpd-virtual-user/vsftpd_user
vi /etc/vsftpd/vsftpd-virtual-user/user
local_root=/home/USERNAME
cmds_allowed=USER,PASS,SYST,FEAT,OPTS,PWD,TYPE,PASV,LIST,STOR,CWD,MKD,SIZE,MDTM,CDUP,RETR,RNFR,RNTO,QUIT
local_umask=022
write_enable=YES
To allow delete add DELE
Other options:
cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST, PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR, RNTO,SITE,SIZE,STOR,TYPE,USER,ACCT, APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST
Allow another user write STOR files: usermod -a -G user another_user