sudo apt install vsftpd
mkdir -p ~/app/ftp
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak.copy
cd
sudo mv /etc/vsftpd.conf .
perl -i.bak -e 'my $name=`whoami`;chomp ($name);my $chr="/home/"."$name";my $num;my @arr;open(RF,"vsftpd.conf");while(<RF>){push @arr,$.};$num=pop (@arr);while(<>){if ($_=~/anonymous_enable=NO/){print "anonymous_enable=YES"."\n";next};if ($_=~/local_enable=YES/){print "local_enable=NO"."\n";next};print $_;if($.==$num){print "anon_root=".$chr."/app/ftp"."\n"}}' vsftpd.conf
sudo mv vsftpd.conf* /etc/
sudo chown root:root /etc/vsftpd.conf
sudo ufw allow 21
sudo ufw allow 20
sudo service vsftpd restart