File Transfer Protocol

File Transfer Protocol

Install & Setting up VSFTP - Very Secure File Transfer Protocol

First, on the server or on the machine that shares a folder:

apt install vsftpd

The configuration of vsftp is in /etc/vsftpd.conf Review and change settings

vim /etc/vsftpd.conf

This is an example of configuration for a server that allows RWX to all users anonymously

 listen=NO
     listen_ipv6=YES
     anonymous_enable=YES
     anon_umask=000
     local_enable=NO
     write_enable=YES
     local_umask=000
     anon_upload_enable=YES
     anon_mkdir_write_enable=YES
     anon_other_write_enable=YES
     dirmessage_enable=YES
     use_localtime=YES
     xferlog_enable=YES
     connect_from_port_20=YES
     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

And then restart with:

/etc/init.d/vsftpd restart
Folder, permissions and owners

For example, we will call ftp to the folder we share:

mkdir /srv/ftp

And ftp to the anonymous user

adduser ftp

With parameters:

chmod -R a+r /srv/ftp

chown user:ftp /srv/ftp

Then on the computers that will be connected to the server

install filezilla

With the ip route command we will find the IP that we need to give to the users to connect to the shared folder If we are at the same network: with the IP we can connect by filezilla to the server and start to copy and share

We can also create a Tor HiddenService for access from anywhere else

apt install tor

Add this at the config file:

vim /etc/tor/torrc
    HiddenServiceDir /var/lib/tor/ftp_service
    HiddenServicePort 21 127.0.0.1:21 

Restart Tor with:

systemctl restart tor

Get the name of the HiddenService

cat /var/lib/tor/ftp_service/hostname