HOW TO SETUP FILE TRANSFER PROTOCOL ON A LINUX SERVER

🦄Installing FTP server-Linux 🦄 

************************ 



 To install an FTP server on Linux Mint, follow the below steps: 

 1) Step 1: Install VSFTPD Our first step will be to install VFTPD on our system. To do so, launch the Terminal in Mint OS by using the Ctrl+Alt+T keyboard shortcut. Then issue the following command in the Terminal to update the system repository index:  $ sudo apt update

  2) Then install VSFTPD using the following command in Terminal:  $ sudo apt install -y vsftpd   

3) After the installation of VSFTPD is completed, we will move towards configuration.  Step 2: Configure VSFTPD The VSFTPD can be configured through the /etc/vsftpd.conf file. Edit the /etc/vsftpd.conf file using the following command in Terminal:  $ sudo nano /etc/vsftpd  

4) Now add or uncomment the following lines (if already added in the file):  listen=NO anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES use_localtime=YES xferlog_enable=YES connect_from_port_20=YES chroot_local_user=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=Yes pasv_enable=Yes pasv_min_port=10000 pasv_max_port=10100 allow_writeable_chroot=YES ssl_tlsv1=YES ssl_sslv2=NO ssl_sslv3=NO

  5) Once done, save and close the /etc/vsftpd.conf file. Step 3: Allow ports in firewall If a firewall is running on your system, you will need to allow some FTP ports through it. Issue the following commands in Terminal to allow the ports 20 and 21:  $ sudo ufw allow 20/tcp $ sudo ufw allow 21/tcp 

 6) You can verify whether the port has been allowed in the firewall or not using the following command in Terminal:  $ sudo ufw status  Step 4: Enable and run VSFTPD 

 7) Now the VSFTPD is configured and allowed in the firewall; now we can enable and run the VSFTPD services. Here are the commands to do so:  To enable the VSFTPD service to start on boot, issue the following command in Terminal:  $ sudo systemctl enable vsftpd.service  

8) To run the VSFTPD service, issue the following command in Terminal:  $ sudo systemctl start vsftpd.service If you need to restart the VSFTPD service after making any configuration changes, issue the following command in Terminal:  $ sudo systemctl restart vsftpd.service  

9) To verify if the VSFTPD is active and running, issue the following command in Terminal:  $ sudo systemctl status vsftpd.service  

10) Step 5: Create an FTP user Next, create a user account that will be used to test the FTP connection. Issue the following commands in Terminal to create a user account and set a password:  $ $ sudo adduser <username> $ sudo passwd <username> Step 6: Test FTP connection 

 11) Now our FTP server is ready, so it’s time to test the FTP connection.  To test FTP connection locally, issue the following command in Terminal by replacing the <ip-address> by the actual IP address of your FTP server:  $ ftp <ip-address>  

12) You can also test the FTP connection remotely by using the same above command from the remote system. I have tested the FTP connection from the Windows machine on the network.

Comments