How to Install and Configure FTP on ubuntu 20.4.1

To Install and Configure FTP on ubuntu 20.4.1

The FTP expanded as the File Transfer Protocol is used for the transfer of computer files between a client and server over a computer network. Let us see a quick introduction on FTP.

Introduction:

• The expansion of FTP is File Transfer Protocol. Transfer files form one directory to another directory.

• The FTP server have port numbers. That are 20,21

• It can provide individual user name and password to the users.

• In FTP have two type of accounts those are

1. Anonymous Account : This was public account. Every user can transfer the files under this account.

2. Normal user account : Only the particular user can only access this account. Its ask the user and password.

Installation process:

To check the installed version of OS, run the following command.

root@linuxhelp:~#  lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal

Install FTP: To install FTP, type below command.

root@linuxhelp:~# apt install vsftpd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  vsftpd
0 upgraded, 1 newly installed, 0 to remove and 152 not upgraded.
Need to get 115 kB of archives.
After this operation, 338 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 vsftpd amd64 3.0.3-12 [115 kB]
Fetched 115 kB in 3s (36.0 kB/s)
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 184474 files and directories currently installed.)
Preparing to unpack .../vsftpd_3.0.3-12_amd64.deb ...
Unpacking vsftpd (3.0.3-12) ...
Setting up vsftpd (3.0.3-12) ...
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /lib/systemd/system/vsftpd.service.
vsftpd.conf:1: Line references path below legacy directory /var/run/, updating /var/run/vsftpd/empty → /run/vsftpd/empty; please update the tmpfiles.d/ drop-in file accordingly.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.2) ...

Once completed create a ftp user using below command:

root@linuxhelp:~# adduser ftpuser
Adding user `ftpuser' ...
Adding new group `ftpuser' (1003) ...
Adding new user `ftpuser' (1003) with group `ftpuser' ...
Creating home directory `/home/ftpuser' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for ftpuser
Enter the new value, or press ENTER for the default
	Full Name []:
	Room Number []:
	Work Phone []:
	Home Phone []:
	Other []:
Is the information correct? [Y/n]

Once above step is completed restart the ftp service by using below command:

root@linuxhelp:~# systemctl restart vsftpd

Once completed goto below location by using below command to create some directory or file:

root@linuxhelp:~# cd /home/ftpuser/

Then create a directory name and file name by using below command:

root@linuxhelp:/home/ftpuser# mkdir share

root@linuxhelp:/home/ftpuser# touch file

After that open browser and type ftp ip address like that in snap1

Then type username and password like that in snap2

Then it will show the ftp server like that in snap3

Once completed then check to disallow that ftp user by using below steps: Goto below location:

root@linuxhelp:~# cd /etc/

Open that file by using below command:

root@linuxhelp:/etc# nano ftpusers

Then type ftp user name in that file to disallow ftp user like that in snap4

Now it will not work in browser

With this method to install FTP on ubuntu comes to end.

Tag : FTP Ubuntu
FAQ
Q
What are the ports are available in FTP server?
A
There are two ports in FTP server.
They are: 20,21.
Q
How many types of accounts in FTP server?
A
There are two types of FTP server accounts
1. Anonymous account( Public account)
2. Normal user account
Q
How to restart ftp server?
A
By using below command we can restart ftp server
# systemctl restart vsftpd
Q
How to open configuration file for ftp?
A
By using below command we can open
# vi /etc/vsftpd/vsftpd.conf
Q
What does VSFTP stands for?
A
VSFTP stands for Very Secure File Transfer Protocol.