How to configure ftp server on centos 6
2 mins read

How to configure ftp server on centos 6

 

Description : 

* 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.

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.

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. 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@user ~]# useradd -d /ftp/user1 user1
[root@user ~]# passwd user1
Changing password for user user1.
New password:

 

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

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/user1 folder

[root@user ~]# touch /ftp/user1/test
[root@user ~]# touch /ftp/user1/test1
[root@user ~]# touch /ftp/user1/test2

Now open ftp path in remote machine browser ftp://ftp-server-IP ( ftp://123.45.56.789 ).

You can see the created files after authentication.

 

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.