One of the most common ways to transfer files between computers is using the File Transfer Protocol (FTP). To set up an FTP server on Ubuntu, one of the most popular choices is vsftpd. In this article, we'll show you how to install and configure vsftpd on Ubuntu 22.04.
Step 1: Update Ubuntu
Before we begin installing vsftpd, we need to make sure that our Ubuntu server is up to date. Open a terminal and run the following commands:
sudo apt update
sudo apt upgrade
Step 2: Install vsftpd
Now that our system is up to date, let's install vsftpd. To do so, run the following command:
sudo apt install vsftpd
Step 3: Configure vsftpd
By default, vsftpd should be up and running after the installation is complete. However, we'll need to make some changes to the configuration file to ensure that it's secure and set up the way we want it.
Open the vsftpd configuration file in your favorite text editor. We'll use nano:
sudo nano /etc/vsftpd.conf
Step 4: Allow Local Users to Access FTP
By default, vsftpd doesn't allow local users to access FTP. To enable local user access, we'll need to uncomment (remove the "#" symbol) from the following line:
Change it to:
Step 5: Set FTP User Home Directory
By default, vsftpd will jail users to their home directory. To set a custom directory, find and uncomment the following line:
Change it to:
Then, add the following line at the end of the file to set the custom directory:
Make sure to replace "/path/to/directory" with the actual path to the directory you want to use.
Step 6: Allow FTP Passive Mode
Passive mode is a way for FTP clients to connect to servers through firewalls. To enable passive mode, add the following lines to the end of the configuration file:
Replace "YOUR_SERVER_IP_ADDRESS" with the IP address of your Ubuntu server.
Step 7: Restart vsftpd
After making changes to the configuration file, we'll need to restart vsftpd for the changes to take effect. To do so, run the following command:
sudo systemctl restart vsftpd
Step 8: Test FTP Connection
To test if your FTP server is working, you can use a client such as FileZilla. Open FileZilla and enter your server's IP address, username, and password. If everything is set up correctly, you should be able to connect to your server and transfer files.
In this article, we've shown you how to install and configure vsftpd on Ubuntu 22.04. With vsftpd, you can set up a secure and reliable FTP server for transferring files between computers.
Related Searches and Questions asked:
That's it for this post. Keep practicing and have fun. Leave your comments if any.