Responsive Ads Here

Monday, 16 April 2018

How to Install and Configure FTP Server on CentOS 6 VPS


Introduction

File Transfer Protocol (FTP) is a standard network protocol used for the transfer of computer files between a client and server on a computer network. FTP is built on a client-server model architecture and uses separate control and data connections between the client and the server.

Very Secure FTP Daemon (VSFTPD) is an FTP server for Unix-like system, including Linux. It is secure and extremely fast. It is stable.

In this article, I will show you How to Install and Configure FTP Server on CentOS 6.
Okay now, I assume that you have login as the root user.

Let's begin the tutorial!

Step One: Install VSFTPD and FTP client

Now, input the following commands:
yum -y install vsftpd

Then after it's done, we need install the FTP client by typing:
yum -y install ftp

Step Two: Configure VSFTPD

Once VSFTPD is installed, we can adjust the configuration.

Open up the configuration file by run the following command:
nano /etc/vsftpd/vsftpd.conf

One primary change is we have to not allow anonymous.
Find this line:
anonymous_enable=YES
And change it to:
anonymous_enable=NO

Prior to this change, vsftpd allowed anonymous, unidentified users to access the VPS's files. This is useful if you are seeking to distribute information widely, but may be considered a serious security issue in most other cases.

After that, uncomment the local_enable option, changing it to yes.
local_enable=YES

Then, block the other FTP users from accessing any other part of the server by changing this line:
chroot_local_user=YES

When it's done, save and exit.

Now, we need to restart VSFTPD to apply the changes by run the following command:
service vsftpd restart

In order to ensure that vsftpd runs at boot, run chkconfig:
chkconfig vsftpd on

Step Three: Access the FTP Server

Once you have installed the FTP server and configured it to your liking, you can now access it.

You can reach an FTP server in the browser by typing the domain name into the address bar and logging in with the appropriate ID. Keep in mind, you will only be able to access the user's home directory.

Example: ftp://example.com

Note: If you can't access your FTP server in the browser, it might the firewall block your visit by default. To fix it, you need to open FTP port 21 to make it accessible:
/sbin/iptables -I INPUT -p tcp --dport 21 -j ACCEPT
/etc/rc.d/init.d/iptables save

That's it.  You have installed an FTP Server onto your VPS server.

No comments:

Post a Comment