How to Setup FTP Server step by step in CentOS 6.5

This tutorial shows you how to install and configure FTP server in CentOS 6.5. Though the steps provided here are tested in CentOS 6.5. In this tutorial my ftp server ip and hostname are 192.168.1.150 and ansh.geniusansh.com respectively.

Before proceed, stop the firewall. 
[root@ansh ~]# service iptables stop
[root@ansh ~]# chkconfig iptables off
Now let us install FTP service.
 [root@ansh ~]# yum install vsftpd -y
 [root@ansh ~]# service vsftpd start

Enable vsftpd in multi-user levels.
 
 [root@ansh ~]# chkconfig vsftpd on

Now edit the /etc/vsftpd/vsftpd.conf file. Uncomment and edit the lines as below mention.
 
 anonymous_enable=YES to NO 
 uncomment below 2 line
ascii_upload_enable=YES 
ascii_download_enable=YES
set banner like below  
ftpd_banner=Welcome to ANSH FTP service.
 edit the below line to end of the file.
use_localtime=YES
Now let us restart the vsftpd service and try to connect to ftp server.
 [root@ansh ~]# service vsftpd restart
Connect to the ftp server.
Note: Root is not allowed to connect to ftp server by default for security purpose. So lets us create a new user called testftp.
 [root@ansh ~]# useradd testftp
[root@ansh ~]# passwd testftp

Connet to FTP server using the new user testftp.
[root@ansh ~]# ftp 192.168.0.150
-bash: ftp: command not found
 
[root@ansh ~]#
Oops! ftp package is not installed. So let us install ftp package first.
 [root@ansh ~]#yum install ftp -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.osuosl.org
 * epel: mirror01.idc.hinet.net
 * extras: centosp3.centos.org
 * updates: centosk2.centos.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.i686 0:0.17-54.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch            Version                   Repository       Size
================================================================================
Installing:
 ftp            i686            0.17-54.el6               base             56 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 56 k
Installed size: 91 k
Is this ok [y/N]: y
Downloading Packages:
ftp-0.17-54.el6.i686.rpm                                 |  56 kB     00:01    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : ftp-0.17-54.el6.i686                                         1/1
  Verifying  : ftp-0.17-54.el6.i686                                         1/1

Installed:
  ftp.i686 0:0.17-54.el6                                                       

Complete!

It shows a error that the user cannot change to his $HOME directory. then u just put this below command
[root@ansh ~]# setsebool -P ftp_home_dir on
 
And finally connect to the FTP server.
 
[root@ansh ~]# ftp 192.168.0.150
Connected to 192.168.0.150 (192.168.0.150).
220 Welcome to ANSH FTP service.
Name (192.168.0.150:root): testftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/testftp"
ftp> quit
421 Timeout.
 
Its working now. You can use your FTP server.
Connect to server using filezilla
Download and install Filezilla client software to any one of the client systems. Open the Filezilla client and enter the username and password which we have created earlier and click connect.
Connet to FTP Server via Browser from any client.

Open the browser and navigate to ftp://192.1168.1.150. Enter the username and password which we cretaed earlier.

Thats it. You can access your FTP server from any client now using Filezilla and as well as from your client web browser.
 

Have a good day!!!


 
 
 

Comments

Popular posts from this blog

Step By Step Configuration Cisco VoIP Phone in Cisco Packet Tracer.

How To Setup Social Publishing CMS (Content Managemnet System) Using Pligg in CentOS 6.5

How To Install And Configuring OpenFire XMPP Chat server on centos 6.5