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.0.160 and roman.geniusansh.com respectively.
Before proceed, stop the firewall. 
[root@sohil ~]# service iptables stop
[root@sohil ~]# chkconfig iptables off
Now let us install FTP service.
 [root@sohil ~]# yum install vsftpd -y
 [root@sohil ~]# service vsftpd start

Enable vsftpd in multi-user levels.

 [root@sohil ~]# chkconfig vsftpd on

Now edit the /etc/vsftpd/vsftpd.conf file. Uncomment and edit the linesas 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@sohil ~]# 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@sohil ~]# useradd testftp
[root@sohil ~]# passwd testftp

Connet to FTP server using the new user testftp.
[root@sohil ~]# ftp 192.168.0.160
-bash: ftp: command not found
 [root@sohil ~]#
Oops! ftp package is not installed. So let us install ftp package first.
 [root@sohil ~]#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@sohil ~]# setsebool -P ftp_home_dir on
And finally connect to the FTP server.
[root@sohil ~]# ftp 192.168.0.160
Connected to 192.168.0.160 (192.168.0.160).
220 Welcome to kismat FTP service.
Name (192.168.0.160: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.168.0.160 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