Author: Ricky Bryce (Montgomery County, Illinois)
| Click here to learn why Christ came to this Earth for us! | Get 10% off VPSLink! Enter REFERRAL code MJDCDJ |
VSFTP (FTP Server)
Now we'll configure the Very Secure File Transfer Protocol Server (VSFTP) VSFTP is already installed on your virtual CENTOS machine. We just have to configure it to be able to accept passive FTP on certain ports, and limit users to their own directory.
Log on to your server as a standard user.
Type su to gain root access. (You will be prompted for the root password)
Type yum install vsftpd to install the vsftpd server. You will be prompted to confirm the installation.
Type cd /etc/vsftpd/ to enter the configuration directory for the server.
Type vi vsftpd.conf to edit the configuration file.
Type /anonymous_enable to locate code that enables anonymous users.
Hit “i” for insert mode within the vi editor
Cursor to the end of the line, and set the anonymous_enable directive to the value of NO as shown:

Hit esc on your keyboard.
Type /connect_from_port_20
Tap “i” for insert mode.
Using your mouse keys, go to the end of the line, then press enter.
Add the passive min and max port as shown. This sets up the random ports which are used for passive connections. (sixty-thousand to sixty-thousand five hundred)

Next, we are going to jail users to the own home directory using a chroot directive, so press esc on your keyboard to get back to command mode.
Type /chroot to search for the chroot section of the vsftpd configuration file.
Tap “i” for insertion mode
Using your cursor keys you must add the chroot_local_user=YES directive at the location as shown below. This line does not exist, so you must add it at the appropriate location for the purpose of organization within the configuration file.

Press esc to exit to command mode.
Now hit :wq (colon, then w for write, and q to quit)
Now, we'll start the vsftp server. Type /etc/init.d/vsftpd start (We'll configure this to start automatically later when the machine boots)

Next, let's test the FTP server. You can download your favorite FTP client. I like to use FileZilla. You can download from filezilla-project.org
Run FileZilla, and enter the hostname, username and password of your standard user. Here you can see that the FTP client is working fine, and if you double click the public_html folder, you will see the index.html file which we created earlier.

The user can now drag files into the public_html folder for use on his web page
