CentOS Tutorial – How to install FTP Server on CentOS 7 using Vsftpd

Hello everyone, today I am going to install FTP Server on CentOS 7 using vsftpd. There are several ways to have a private FTP Server instead of using vsftpd. But here I will only cover the vsftpd. FTP Server is an old file transfer protocol that has been used widely over the years. With FTP Server we can easily upload or download files from our local computer to the remote FTP Server.

install ftp server on centos 7

Operating System Details:

  • Distribution: CentOS 7 minimal install
  • Kernel: 3.10-0
  • Ip address: 10.34.0.247

How to install FTP Server on CentOS 7

Step 1. Install vsftpd

First, we need to install vsftpd package on CentOS 7. Since I am using CentOS 7 minimal install, with no GUI, all tasks will be done via Terminal command.

[root@localhost ~]# yum install vsftpd
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
 * base: sumberterbuka.beritagar.id
 * extras: sumberterbuka.beritagar.id
 * updates: sumberterbuka.beritagar.id
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:3.0.2-21.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================
 Package                   Arch                      Version                            Repository               Size
======================================================================================================================
Installing:
 vsftpd                    x86_64                    3.0.2-21.el7                       base                    169 k

Transaction Summary
======================================================================================================================
Install  1 Package

Total download size: 169 k
Installed size: 348 k
Is this ok [y/d/N]:

Step 2. Configure vsftpd

Edit the file /etc/vsftpd/vsftpd.conf

nano /etc/vsftpd/vsftpd.conf

Now find the following sections and change it to the one below.

Disable anonymous access

# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO

Allow ASCII Mode

# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES

Specify chroot list

# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
chroot_list_enable=YES

Uncomment ls_recurse_enable

# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES

Change ipv4 listen setting

# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
listen_ipv6=NO

Add this to the last line

seccomp_sandbox=NO

Change Firewall to allow vsftpd

firewall-cmd --add-service=ftp --permanent 
firewall-cmd --reload

Now add any user you want to give access to the chroot_list file

nano /etc/vsftpd/chroot_list

For example I add “dhani” to the file.

Start vsftpd service

systemctl start vsftpd

Check the status

[root@localhost ~]# systemctl status vsftpd
● vsftpd.service - Vsftpd ftp daemon
   Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-05-12 20:57:00 EDT; 2s ago
  Process: 3795 ExecStart=/usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 3796 (vsftpd)
   Memory: 732.0K
   CGroup: /system.slice/vsftpd.service
           └─3796 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf

May 12 20:57:00 localhost.localdomain systemd[1]: Starting Vsftpd ftp daemon...
May 12 20:57:00 localhost.localdomain systemd[1]: Started Vsftpd ftp daemon.

Step 3. Test the FTP Connection

Now you can try to connect to your ftp server from other computer. For example, I connect to my new ftp server from command line.

[root@fedora ~]# ftp 10.34.0.247
Connected to 10.34.0.247 (10.34.0.247).
220 (vsFTPd 3.0.2)
Name (10.34.0.247:root): dhani
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

At this point our FTP server is ready. Thanks for reading this tutorial on how to install ftp server on CentOS 7. Please consider sharing this article if you think its useful. Bye

6 Comments

  1. I blog often and I really thank you for your information. The article has really peaked my interest.
    I am going to take a note of your site and keep checking for new details about once per week.
    I subscribed to your Feed as well.

  2. After exploring a handful of the articles on your site, I
    really like your way of writing a blog. I bookmarked it to my bookmark site list
    and will be checking back soon. Please check out my web site as well and tell me how you feel.

Leave a Reply