Install and configure FTP server in Redhat/Centos Linux?

27493

FTP stands for File Transfer Protocol. It was written by Abhay Bhushan and published in 1971. FTP is supported by all the operating systems and browsers.

It is a client-server based protocol.

How FTP works

Step a: Client connects to server on port 21.

Step b: Server responds and ask for authentication.

Step c: Client decides weather to connect passively or actively and authenticate with credentials(user name password).

Step d: If it is an active connection, server opens port 20 for data transfer and gives ftp prompt after successful authentication.

Installing FTP server in Centos

Step 1: We will use below host name and IP address for our test machine to setup FTP server

Server IP: 192.168.0.9

Host Name: ftp.linuxnix.com

Just edit file /etc/hosts

#vi /etc/hosts

and add the line on bottom and save

192.168.0.9  ftp.linuxnix.com

Step 2: Install vsftpd (very secure FTP daemon) package.

#yum install vsftpd ftp

Configuring FTP server in Linux Centos

Step 3: Configure vsftpd package. We will edit /etc/vsftpd/vsftpd.conf you can do this with gedit (If installed) or vi command.

#vi /etc/vsftpd/vsftpd.conf

Change the line which contain anonymous_enable=YES to anonymous_enable=NO. This will permit any one to access FTP server with authentication.

anonymous_enable=YES   

Uncomment the following line

local_enable=YES                                    allow users in /etc/passwd to login

write_enable=YES                                   allow users to write files. “NO†will permit only to read.

Change the line chroot_local_user=NO to chroot_local_user=YES. This will permit local user as FTP account. If you add an user, it will be treated as a FTP account as well.

The local user directory will be the FTP directory.

 

Step e: Client call for file and server initiates file transfer.

Following picture shows a simple way of data transfer through ftp.

Read Full Poat:  http://www.linuxnix.com/7-steps-to-install-and-configure-ftp-server/