How to Setup FTP Server on Centos ( VSFTP ) (with Pictures)
Edit Article

  • 1 Editor

FTP ( File Transfer Protocol ) server is used to exchange files between computers over a network other than that. FTP ( File Transfer Protocol ) is probably the most popular method of uploading files to the server; a variety of FTP servers , such as vsftpd , and existing clients for all platforms. Vsftpd ( Very Secure FTP Daemon ) is an FTP server that was developed by Chris Evans. Vsftpd created with adequate levels of security to cover some of the problems found in the conventional FTP server. The use of chroot ( ) on vsftpd can restrict visibility in the user directory server. In addition , we can use OpenSSL to encrypt file transfers. As an FTP server , vsftpd supports passive and active mode , and works on port 21 or it could be the port that we set yourself. Vsftpd Installation is straightforward , this guide will help you to setup an ftp server on CentOS 7 . This guide contains the configuration steps for both FTP and SFTP and user creation . Here I 've used the package vsftp secure. And this time I will discuss about how to setup FTP server on CentOS 7, read more.

a) FTP Server b) SFTP Server c) User Creation Installation FTP Server Step 1 » Update repository and install the package vsftpd Just type the following command :


Vsftpd configuration file located in the / etc / vsftpd . There are 4 pieces of files namely : ftpusers , USER_LIST vsftpd.conf , . Vsftpd.conf the main configuration file , in which there are directives that we can change according to need . Ftpusers file is a text file that will be used to restrict users who can access the FTP server , simply by entering a user name into the file , then the user will not be allowed to access the FTP server. USER_LIST default file contains a list of users who are allowed to access the FTP server , but if the directive " userlist_enable = YES " ( default ) in the main configuration file ( vsftpd.conf ) , then the same function as file ftpusers where USER_LIST this file will not allow users registered to access the FTP server . Step 2 » After installation you can find /etc/vsftpd/vsftpd.conf file is the main configuration file for vsftp . Taking a backup copy before making any changes.


Now open the file and make changes as below .


Search this anonymous_enable line = YES ( Line no: 12 ) and change the value NO to disable anonymous FTP access, or unknown users to access files via FTP ; anonymous_enable change the setting to NO.


Signs comment below the line ( Line no: 100 ) to restrict users to their home directories and remove the # sign on the left side chroot_local_user = YES


and add a line below at the end of the file to enable passive mode and enable chroot written.


Step 3 » Now restart vsftpd service and make it start automatically after reboot


Step 4 » Add the FTP service on the firewall to allow port ftp


Step 5 » SEinux settings to allow access ftp directory home users.


Step 6 »Now allows users to access ftp . Here / sbin / nologin shell shell is used to prevent access to the server .


Now users can be logged FTP on port 21. Note : If after completing the configuration, you can not access the ftp server , and an error occurs . 500 OOPS: cannot change directory: /var/www/html/testftp Try to check whether your ftp_home_dir off or on by means:


If ftp_home_dir you off , then set on with a command like this:


SFTP server SFTP ( Secure File Transfer Protocol ) is used to encrypt the connection between the client and FTP server . It is highly recommended to use SFTP because the data is transferred over an encrypted connection using SSH - tunnel on port 22 . Basically, we need server OpenSSH package to enable SFTP. Server Install OpenSSH package , if not already installed .


Step 7 » Create a separate group for FTP access . groupadd FTP access Step 8 » Now open / etc / ssh / sshd_config file and make changes as below . Search and comments below the line ( Line no: 147 ) .


and add the lines below : Subsystem sftp internal-sftp Match group ftpaccess ChrootDirectory %h X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp Step 9 » Now restart sshd service .


User Creation Step 10 » Create a user you with / sbin / nologin shell and ftpaccess group .


Now assign ownership to root for the home directory chroot access and modify the permissions


Create a www directory in the home directory to write and modify ownership


Now the user can use both FTP and SFTP services . He can upload files in the directory www . if you will be using FTP and SFTP together on the same server , you must follow the above steps while creating the user . For existing users and add them to the ftpaccess made the change .


I will review some of the advantages and disadvantages CentOS and FTP. This is a question often asked potential users of CentOS. But unfortunately, many are not able to give an honest answer . Linux generally people say all the same, depending on the power of mastery administrator. This answer is clearly wrong! Why wrong ? Because whoever would certainly not accept this answer and promptly conduct a search deeper and asked Google and read here and there not? Well, we will write honestly advantages and disadvantages CentOS.

While the excess and deficiency FTP is :

Advantages of FTP

  • Simplify the FTP can upload data
  • FTP can transfer data
  • On -line FTP there is a facility to upload data to the server in large quantities at once so no one by one .
  • On the FTP can serve to exchange files
  • FTP is the most brand new version also comes with a set of programs audit and handling accounts.

Disadvantages of FTP

  • FTP is an unsafe manner in transferring a file because the file is sent without encryption in advance but through clear text . Mode text used for data transfer format is ASCII or binary format .
  • Security and ease of use are often hit and concern for system administrators .
  • FTP design is still weak , resulting not information system administrator about the risks they face

Now, we already know about FTP server and as I explained in my previous tutorial on how to setup FTP server which explains why we need to use FTP server, especially for a newbie. I would be happy if it can help you, so don't forget to always connect to our website for more.

Let's doing and Enjoy !!!

Article Tools

Did this article help you?


an Author!

Write an Article