How to Install and Configure vsftpd on CentOS 7
FTP (File Transfer Protocol) is one of the most popular methods to upload files to a server. There exist a wide array of FTP servers, such as vsftpd, you can use and FTP clients exist for every platform.
Essentially no matter what OS you use you can find an easy to use FTP client, so it makes for a great solution to transfer files. On CentOS based servers before you can connect via FTP you'll have to setup an FTP server. Here we're gonna setup vsftpd which is a great option since it has a focus on security and speed.
Installing vsftpd on CentOS 7
- These instructions are intended for installing the vsfptd software on a CentOS 7 VPS server but will work on many of our other server types as well.
- You must be logged in via SSH as the root user to follow these directions.
- Install vsftpd
- Before installing new software, it's always best practice to run updates:
yum -y update
- Then install vsftpd and any required packages:
yum -y install vsftpd
- Before installing new software, it's always best practice to run updates:
- Configure vsftpd
For a refresher on editing files with vim see: New User Tutorial: Overview of the Vim Text Editor - Edit vsftp Configurations
Now let's edit the configuration file for vsftpd. Open the file with the following command:vim /etc/vsftpd/vsftpd.conf
Now that the file is opened up you'll want to make the following changes. Either find the option line and edit it, or simply delete it and replace with the lines noted here. - Disallow anonymous logins; this allows unidentified users to access files via FTP. Ensure that the anonymous_enable setting to NO:
anonymous_enable=NO
- Enable local users to login, this will allow your regular user accounts to function as FTP accounts. Change the local_enable setting to YES:
local_enable=YES
- If you want local user to be able to write to a directory, then change the write_enable setting to YES:
write_enable=YES
- Local users will be 'chroot jailed' and they will be denied access to any other part of the server. Set the chroot_local_user setting to YES:
chroot_local_user=YES
- Exit and save the file with the command `:wq`, or with `:x`.
- Restart and Enable the vsftpd service:
- First restart the service:
systemctl restart vsftpd
- Then set the vsftpd service to start at boot:
systemctl enable vsftpd
- First restart the service:
- Allow vsftpd Through the Firewall
- Allow the default FTP port, port 21, through firewalld:
firewall-cmd --permanent --add-port=21/tcp
- And reload the firewall:
firewall-cmd --reload
- Allow the default FTP port, port 21, through firewalld:
And that is it! You should now have vsftpd installed, setup and configured on your server. If you followed these directions you should now be able to login to the server via FTP! If you have a hardware firewall in addition to the servers software firewall, you may need to adjust those setting too.
Not getting the support you need? Liquid Web’s VPS servers outmatch the competition on performance and support. We can migrate your data over to our environment for free. Check out how the difference in quality today!
Related Articles:
- What is CentOS? Everything You Need to Know
- Check Apache Status with systemctl status and apachectl status Commands
- How to Find the Server Name Indication (SNI) Supporting Details
- How to Install Pip on CentOS 7
- Get Kernel Version for Linux: A Guide
- What Is a Time Series Database? How It Works & Use Cases

About the Author: David Singer
I am a g33k, Linux blogger, developer, student, and former Tech Writer for Liquidweb.com. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install WordPress on Linux (AlmaLinux)
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleRedis as Cache: How It Works and Why You Should Use It
Read ArticleRefer-a-Friend Program for Website Hosting: Get $100 for Each Friend!
Read Article