frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

[Ubuntu] How to set up an FTP server on Ubuntu 14.04 or 16.04

ReginaRegina Moderator
edited December 2018 in Various Tutorials
For this tutorial we will be using one of the most popular vsftpd services for creating FTP server on your Ubuntu 14.04 and 16.04. After creating FTP server, you will be able to create new users for loging into your server via FTP.  

0. Preliminary requirements:

VPS with Ubuntu 14.04 or 16.04 operating system installed.

1. Login into your server using SSH and upgrade it:

 apt-get update 

2. Install the service:

 apt-get install vsftpd

3. Change settings:

Now we will need to change the necessary settings in the vsftpd configuration file. Open up the file:
 vi /etc/vsftpd.conf
In this file find these lines and set up the necessary settings to be seen like this:

listen=YES
local_enable=YES
write_enable=YES
chroot_local_user=YES

Quit and save the file.

4. Restart the service:

 sudo service vsftpd restart

5. Add new FTP user:

 sudo adduser youruser
Then enter the password for this user two times and provide information if needed about that user. You can leave the additional information of the user blank by pressing "ENTER".

6.  Provide access permissions

After the FTP user is created, you can connect with it remotely via FTP Client, for example, FileZilla. However, if you will try to login now, you will get the error ("500 OOPS"), which means you do not have the necessary permissions.

In order to maintin security for the server via FTP, the recommended way to allow access is to create subdirectory in the user's root directory with writing access.
 sudo chown root:root /home/youruser
 sudo mkdir /home/youruser/yourfiles
 sudo chown youruser:youruser /home/youruser/uploads
This will let you connect with the new user to FTP server, but the user will not have access to the root directory. The new user will have access to upload files into the newly created folder.

7. Login to FTP

Restart the vsftpd service and login to FTP with new user:
 sudo service vsftpd restart
Now connection via FTP with the created user will be successful.

Sign In or Register to comment.

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2019 Time4VPS. All rights reserved.

Get In Touch