How to Install and Configure FTP Server with User Based Authentication in Ubuntu 16.04, 17.04, 18.04, 19.04

Share on :

How to Install and Configure FTP Server with User Based Authentication in Ubuntu 16.04, 17.04, 18.04, 19.04

Ftp is one of the best way to share files over the network. We can setup user based authentication to secure our ftp server from unwanted access.In this blog we are going to user vsftp( very secure file transfer protocol ) to setup user-based authentication on our ftp server in ubuntu.

To setup FTP Server with Anonoyms access click on the link below.
How to Install and Configure FTP Server (Anonymous) in Ubuntu 16.04, 17.04 , 18.04 & 18.10

1) Install Packages.

sudo apt update -y
sudo apt install vsftpd -y

2) set anonymous access to YES in /etc/vsftpd.conf file.

sudo adduser ftpuser
Adding user `ftpuser’ …
Adding new group `ftpuser’ (1001) …
Adding new user `ftpuser’ (1001) with group `ftpuser’ …
Creating home directory `/home/ftpuser’ …
Copying files from `/etc/skel’ …
Enter new UNIX password: Enter password for user
Retype new UNIX password: Re-enter password for user
passwd: password updated successfully
Changing the user information for ftpuser
Enter the new value, or press ENTER for the default
Full Name []: Gaurav
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y

3) Start and Enable the service.

sudo systemctl start vsftpd
sudo systemctl enable vsftpd

4) Now we can access our FTP server on web browser.

ftp://<your_ip> and pass username and password of the user we just created.

Our Ftp server is up and running now we will upload file to it to share.

Note: The Home directory of the user ftpuser is what we will see on the web browser so we need to add our files to share to the home directory of ftpuser.

Which means the home directory of the user which we see on the web browser so you can add a user with a custom home directory where your data is present or mounted.

The home directory of ftpuser is /home/ftpuser
so here we need to upload file here to share. copy or put your file to /home/ftpuser to share.
I am creating a file to share for my demonstartion purpose.

sudo touch /home/ftpuser/file

Now lets access this on the web browser.

Ftp Clients:-

The Clients in the server network can access the ftp server just by opening their web server and searching ftp:// and passing the username and password

or the Clients can even access it by cli (terminal) by installing ftp client package.

sudo apt install ftp -y

After we install the ftp client package we can access the ftp server by terminal.

Connected to
220 (vsFTPd 3.0.3)
Name ( ftpuser
331 Please specify the password.
Password: Enter the ftpuser password
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r–r– 1 1001 1001 8980 Jan 30 22:59 examples.desktop
-rw-r–r– 1 0 0 0 Jan 31 20:20 file
226 Directory send OK.

Share on :

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *