File Transfer Protocol (FTP) is a standard network protocol that allows users to transfer files between a client and a server on a computer network. In this tutorial, we will walk you through the process of how to install FTP server on Rocky Linux.
Before we get started, make sure you have:
- A Rocky Linux server up and running. If you need help setting up your server, check out our guide on how to add IPs on Rocky Linux.
- Root access to your server, or a user with sudo privileges.
How to Install FTP Server on Rocky Linux
Update Your System
First and foremost, ensure that your system is up to date by running the following command:
sudo dnf update
Install vsftpd on Rocky Linux
For this tutorial, we will be using vsftpd (Very Secure FTP Daemon), a fast, stable, and secure FTP server for Linux. Install vsftpd using the following command:
sudo dnf install vsftpd
Once the installation is complete, enable and start the vsftpd service:
sudo systemctl enable vsftpd sudo systemctl start vsftpd
Configure vsftpd on Rocky Linux
Now that vsftpd is installed, it’s time to configure it. Open the configuration file with your preferred text editor:
sudo vim /etc/vsftpd/vsftpd.conf
Here are some important configuration options to consider:
- anonymous_enable: Set this to “NO” to disable anonymous login.
- local_enable: Set this to “YES” to enable local users to log in.
- write_enable: Set this to “YES” to allow users to upload files.
For example, make sure these lines are present and uncommented in your configuration file:
anonymous_enable=NO local_enable=YES write_enable=YES
Save and close the file after making your changes. Then, restart the vsftpd service for the changes to take effect:
sudo systemctl restart vsftpd
To allow FTP traffic through the firewall, you need to open the necessary ports. Run the following commands:
sudo firewall-cmd --add-service=ftp --permanent sudo firewall-cmd --reload
Test FTP Connection
To test your FTP server, you can use an FTP client such as FileZilla or the command-line ftp utility. For this example, we will use the command-line utility:
Enter your username and password when prompted. If the connection is successful, you should see the FTP command prompt:
You can now use FTP commands to interact with your server, such as
ls to list files,
get to download files, and
put to upload files.
Congratulations! You have successfully installed and configured an FTP server on Rocky Linux. Now you can easily transfer files between your local machine and your server. For more useful tutorials on Rocky Linux, check out the following articles:
- How to install and configure LAMP stack on Rocky Linux
- How to install KVM virtualization on Rocky Linux
- How to set up RAID 1 on Rocky Linux
By setting up an FTP server on your Rocky Linux system, you’ve taken a step towards better file management and improved accessibility for your server. Remember to keep your server up to date and maintain good security practices to ensure the continued success of your FTP server.