Ugacomp

How can I create FTP User Directory in Ubuntu?

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM

CLOUD VPS M

$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM

CLOUD VPS L

$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

“Securely Manage Your FTP User Directory in Ubuntu with Ease!”

Introduction

FTP (File Transfer Protocol) is a popular way to transfer files between computers over the internet. If you are running an Ubuntu server, you may want to create an FTP user directory to allow users to access and upload files to your server.

In this guide, we will show you how to create an FTP user directory in Ubuntu. We will cover how to create a user, set up the directory, and configure the FTP server. By the end of this guide, you will have a secure FTP user directory set up on your Ubuntu server.

Step 1: Install vsftpd.

The first step is to install the vsftpd package. This is a secure, fast, and stable FTP server for Ubuntu. To install the package, open a terminal window and type in the following command:

sudo apt-get install vsftpd

Step 2: Configure vsftpd.

Before you edit the vsftpd configuration file, you need to create a backup copy so that when everything goes wrong, you can just revert back. Here we’re calling the backup copy, vsftpd.config.bak. To do this, we can run the following command:

sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.bak

Now that you’ve successfully backed up your configuration file, you can edit it. To do this, you need to use nano editor and target the FTP configuration file found under this path /etc/vsftpd.conf. Here is the command you will need to run on your terminal:

sudo nano /etc/vsftpd.conf

In this file, you will need to set the following parameters:

 local_enable=YES

write_enable=YES

chroot_local_user=YES

allow_writeable_chroot=YES

pasv_enable=YES

pasv_min_port=40000

pasv_max_port=50000

pasv_address=

userlist_enable=YES

userlist_file=/etc/vsftpd.userlist.

userlist_deny=NO

For more reference, see also the image below that shows the example configuration in the vsftpd file:

Configuring the vsftpd file is critical when setting up ftp user directory

RECOMMENDED READING: Full Step-by-Step Guide to Installing FTP on Ubuntu Server

Step 3: Create the FTP user directory.

It’s time to create the FTP user directory by running the following command:

sudo mkdir -p /home/ftpusers

This will create the FTP user directory in the /home directory.

Step 4: Set the permissions.

The next step is to set the correct permissions for the user directory. To do this, open a terminal window and type in the following command:

sudo chown -R ftpuser:ftpuser /home/ftpusers

This will set the correct permissions for the FTP user directory.

Add new FTP user

We also need to add FTP user to the ftpuser group. We do this by creating a new user using the following command;

sudo adduser ftpusername

Replace ftpusername with the desirable username, you want to create for your FTP user.

We also need to set the password for the new user using the following

 sudo passwd ftpusername

Follow the prompts to set your desired password for the new user

Let’s add the new user to the ftpuser group using the following command:

sudo usermod -aG ftpuser ftpusername

This command adds the user ftpusername to the ftpuser group, which is the group that owns the FTP directory.

Let’s also set the permissions on the FTP directory using the following command:

sudo chmod -R 775 /home/ftpusers

This command sets the permissions on the FTP directory to allow the ftpuser group to read, write, and execute files and directories within the FTP directory

Step 5: Restart vsftpd.

The final step is to restart the vsftpd service. To do this, open a terminal window and type in the following command:

sudo service vsftpd restart

This will restart the vsftpd service and the FTP user directory will be ready for use.

Conclusion

Creating an FTP user directory in Ubuntu is a simple process that can be completed in a few steps. By using the command line, you can create a user directory, assign permissions, and set up an FTP server. This allows you to securely transfer files between computers and share them with other users. With the right knowledge and tools, you can easily create an FTP user directory in Ubuntu.

More related articles to explore

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.
 

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.