You’ve migrated all of your Ubuntu Linux servers to the latest iteration and need to get an FTP server up and running quickly. How do you manage that task? It’s actually incredibly easy. I’m going to show you how to do just that, using the VSFTP server.
VSFTP is a very secure and fast FTP daemon that makes setup and administration very simple. Let’s get this up and running.
What you’ll need
Obviously, you’ll need Ubuntu Server 18.04 installed and running. Outside of that, you’ll need an account with sudo privileges and a few minutes time.
SEE: IT pro’s guide to working smarter with Linux (Tech Pro Research)
The VSFTP daemon is found in the standard repositories, so installation can be pulled off with a single command. Open a terminal window and issue the following:
sudo apt-get install vsftpd
Start and enable the service with the commands:
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
Once that installation completes, you’re ready to continue.
Creating an FTP user
We’re going to make this very easy and create a user for the FTP service that you can then give out to those who need it (and don’t have a user account on the server). This could be considered an account for generic FTP usage. You can always create more, and anyone with a user account on the server can log via FTP. Our user will be called ftpuser and is created with the command:
sudo useradd -m ftpuser
Set the user’s password with the command:
sudo passwd ftpuser
Your user is ready to go.
We’re going to create a brand new configuration file. Before we do that, let’s rename the original with the command:
sudo mv /etc/vsftpd.conf /etc/vsftpd.conf.orig
Create the new file with the command:
sudo nano /etc/vsftpd.conf
In that file, place the following:
At this point, you should be able to log into your FTP server using the ftpuser created earlier. Login with your favorite FTP GUI client or the command line. You can now upload and download files to your heart’s content. Those files will be saved in the home directory of the ftpuser user (so /home/ftpuser). With our configuration file, we’ve disabled anonymous usage, so the only way to log in will be with a working account on the server.
Done and done
That’s it. In about a minute, you’ve created an FTP server on Ubuntu 18.04. It really is that easy. Remember, however, this is pretty basic. The goal was to get it up and running quickly, so you might find it doesn’t perfectly fit your needs. Fortunately, VSFTP is a fairly flexible server. To learn more about what this FTP server can do, issue the command man vsftpd.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays