How to configure ftp server on centos 6

FTP – File transfer protocol is used to transfer files from one host to another over TCP . Configuring ftp server on linux is safe and secure .

In this article we can see how to configure ftp server on centos 6 . please follow the steps.

Configuring ftp server on Centos 6:

Step 1 » Vsftpd is a lightweight FTP server package for Centos (linux) . Start installing package by issuing below command.
[root@leela ~]# yum -y install vsftpd
Step 2 » After installation, Open the file /etc/vsftpd/vsftpd.conf which is the config file for vsftpd ( I mean FTP server ) .
Replace YES to NO in the below line.
anonymous_enable=NO
Find and Uncomment the below lines
local_enable=YES
write_enable=YES
and uncomment this line to limit the users to their home directories.
chroot_local_user=YES
Step 3 » Create a folder where you want to store FTP data. In my case i’m going to create in / ( root folder ) like below .
[root@leela ~]# mkdir /ftp
Step 4 » Now start creating users for accessing ftp server .
[root@leela ~]# useradd -d /ftp/krizna krizna
[root@leela ~]# passwd krizna
Changing password for user krizna.
New password:

You just created username krizna with home directory /ftp/krizna .

Step 5 » Start vsftpd service by issuing the below command.
[root@leela ~]# service vsftpd start
and type this below command to start ftp server service automatically while booting.
[root@leela ~]# chkconfig --levels 235 vsftpd on
Step 6 » That’s it, Now we can check the FTP access .Create some files in /ftp/krizna folder

[root@leela ~]# touch /ftp/krizna/test
[root@leela ~]# touch /ftp/krizna/test1
[root@leela ~]# touch /ftp/krizna/test2

Now open ftp path in remote machine browser ftp://ftp-server-IP ( ftp://172.16.28.135 ). You can see the created files after authentication.

configure ftp server on centos 6

You can use Filezilla or winscp tools to upload/download files from FTP server.

Troubleshooting :

If you not able to connect ftp server , Disable the firewall ( iptables ) and selinux service on your ftp server .
Disable firewall ( Iptables ) »
[root@leela ~]# service iptables stop
[root@leela ~]# chkconfig iptables off

Disable Selinux  » open the file /etc/selinux/config and find the line
SELINUX=enforcing

and replace with
SELINUX=disabled

now reboot the server and try again.

20 Comments

  1. got a problem with vsftpd in centos 6, 500 OOPS: cannot change directory:/home/ftp-docs

    Resolved by problem below command:-
    /usr/sbin/setsebool -P ftp_home_dir 1

  2. i successfully configured ftp server in centos . i connect ftp in clinet. it connects but

    Index of ftp://192.168.153.153/../

    Up to higher level directory

    Name
    Size
    Last Modified

    again i click up to higher level directory

    i am getting

    Index of ftp://192.168.153.153/../../

    Up to higher level directory

    Name
    Size
    Last Modified

    bin

    02/09/2013
    06:51:00 AM

    dev

    02/10/2013
    07:40:00 AM

    etc

    02/10/2013
    08:18:00 AM

    ftp

    02/10/2013
    08:09:00 AM

    lib

    02/09/2013
    06:51:00 AM

    media

    02/10/2013
    07:15:00 AM

    misc

    02/10/2013
    07:40:00 AM

    mnt

    09/23/2011
    12:00:00 AM

    net

    02/10/2013
    07:40:00 AM

    opt

    02/09/2013
    04:37:00 AM

    proc

    02/10/2013
    07:39:00 AM

    sbin

    02/09/2013
    06:51:00 AM

    selinux

    02/10/2013
    07:39:00 AM

    srv

    09/23/2011
    12:00:00 AM

    sys

    02/10/2013
    07:39:00 AM

    tmp

    02/10/2013
    08:09:00 AM

    usr

    02/09/2013
    04:22:00 AM

    var

    02/09/2013
    04:37:00 AM

  3. i successfully configured ftp server in centos . i connect ftp in clinet. it connects but

    Index of ftp://192.168.153.153/../

    Up to higher level directory

    Name
    Size
    Last Modified

    again i click up to higher level directory

    i am getting

    Index of ftp://192.168.153.153/../../

    Up to higher level directory

    Name
    Size
    Last Modified

    bin

    02/09/2013
    06:51:00 AM

    dev

    02/10/2013
    07:40:00 AM

    etc

    02/10/2013
    08:18:00 AM

    ftp

    02/10/2013
    08:09:00 AM

    lib

    02/09/2013
    06:51:00 AM

    media

    02/10/2013
    07:15:00 AM

    misc

    02/10/2013
    07:40:00 AM

    mnt

    09/23/2011
    12:00:00 AM

    net

    02/10/2013
    07:40:00 AM

    opt

    02/09/2013
    04:37:00 AM

    proc

    02/10/2013
    07:39:00 AM

    sbin

    02/09/2013
    06:51:00 AM

    selinux

    02/10/2013
    07:39:00 AM

    srv

    09/23/2011
    12:00:00 AM

    sys

    02/10/2013
    07:39:00 AM

    tmp

    02/10/2013
    08:09:00 AM

    usr

    02/09/2013
    04:22:00 AM

    var

    02/09/2013
    04:37:00 AM

  4. i’ve been succed install and running vsftp, but i got trouble to login ftp with exist user in my system
    always failed when login
    it’s something wrong?

  5. i’ve been succed install and running vsftp, but i got trouble to login ftp with exist user in my system
    always failed when login
    it’s something wrong?

  6. Hi, i have configured vsftpd on centos 6.5, anonymous login is only enabled on it, i cant login using any other account..

  7. Hi, i have configured vsftpd on centos 6.5, anonymous login is only enabled on it, i cant login using any other account..

  8. i installed and configured FTP on centos 6.9. It seems done but I cannot login in FTP client with user root.
    the Error said : 500 OOPS: cannot change directory:/root.
    I may not understand clearly about FTP works.
    Dear All,
    Please help give me the solution.
    Thanks

4 Trackbacks / Pingbacks

  1. Configurar vsftp en Centos Server 6 | blog
  2. Configurar vsftp en Centos Server 6 | Base de Conocimientos
  3. How to setup FTP server on ubuntu 14.04 ( VSFTPD )
  4. Setup FTP server on centos 7 ( VSFTP )

Leave a Reply

Your email address will not be published.


*