How to build an FTP server in Linux

Source: Internet
Author: User
Tags ftp connection ftp site ftp protocol what is ftp

How to build an FTP server in Linux

In this tutorial, I will introduce how to build your own FTP server. However, we should first learn what FTP is.

What is FTP?

FTP is the abbreviation of File Transfer Protocol. As the name implies, FTP is used for file transmission between computers over the network. You can transfer files between your computer account through FTP, transfer files between your account and your desktop computer, or access online software archiving. However, it should be noted that most FTP sites have very high usage and may need to be reconnected for multiple times.

The FTP address is very similar to the HTTP address (that is, the webpage address), but the FTP address uses the ftp: // prefix instead of http ://

What is an FTP server?

Generally, computers with FTP addresses are dedicated to receiving FTP connection requests. A computer dedicated to receiving FTP connection requests is an FTP server or FTP site.

Now, let's start a special adventure. We will build an FTP service to share files with family members and friends. In this tutorial, we will use vsftpd as the ftp service.

VSFTPD is the most secure FTP server software. In fact, the first two letters of VSFTPD indicate "very safe (very secure )". This software bypasses the FTP Protocol Vulnerability.

Even so, you should know that there are more secure methods for file management and transmission, such as SFTP (using OpenSSH ). The FTP protocol is very useful and reliable for sharing non-sensitive data.

Install VSFTPD with rpm:

You can use the following command to quickly install VSFTPD on the command line interface:

  1. dnf -y install vsftpd
Use deb to install VSFTPD:

You can use the following command to quickly install VSFTPD on the command line interface:

  1. sudoapt-get install vsftpd
Install VSFTPD in Arch:

You can use the following command to quickly install VSFTPD on the command line interface:

  1. sudo pacman -S vsftpd
Configure the FTP service

Most VSFTPD configuration items are in the/etc/vsftpd. conf configuration file. This file is already well documented. Therefore, in this section, I only emphasize some important options that you may modify. Use the man page to view all available options and basic documentation instructions:

  1. man vsftpd.conf

According to the file system level standard, FTP shared files are located in the/srv/ftp directory by default.

Upload allowed:

To allow ftp users to modify the file system content, such as uploading files, the "write_enable" flag must be set to YES.

  1. write_enable=YES

Allow local (system) User Logon:

To allow users recorded in the file/etc/passwd to log on to the ftp service, the "local_enable" flag must be set to YES.

  1. local_enable=YES

Anonymous User Logon

The following configuration controls whether anonymous users are allowed to log on:

  1. # Allow anonymous users to log on
  2. anonymous_enable=YES
  3. # Password not required for anonymous logon (optional)
  4. no_anon_password=YES
  5. # Maximum transfer rate for anonymous logon, Bytes/second (optional)
  6. anon_max_rate=30000
  7. # Anonymous Logon directory (optional)
  8. anon_root=/example/directory/

Root directory restriction (Chroot Jail)

Chroot jail is a security mechanism in unix-like systems. It is used to modify the root directory environment for running processes, this thread cannot perceive the existence of directory structures and files other than its root directory tree. For more information, see chroot jail)

Sometimes we need to set the root directory (chroot) environment to prevent users from leaving their home directory. Add/modify the following configuration in the configuration file to enable the root directory restriction (Chroot Jail ):

  1. chroot_list_enable=YES
  2. chroot_list_file=/etc/vsftpd.chroot_list

The "chroot_list_file" variable specifies the files/directories contained in the root directory)

Finally, you must restart the ftp service and enter the following command in the command line:

  1. sudosystemctl restart vsftpd

So far, your ftp service has been set up and started.

Four Advanced configurations of vsftpd Server:

VsFTPd configuration Tutorial:

Simple and practical Ubuntu FTP setup

Set up FTP server and Apache server on Ubuntu

Install the LAMP \ vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Simple case of anonymous uploading of SeLinux and vsftpd on the RHEL6 Platform

Install vsftpd source code in Linux

Install and configure the FTP server vsftpd in openSUSE 13.2/13.1

Via: http://itsfoss.com/set-ftp-server-linux/

Author: alimiracle Translator: cvsher Proofreader: wxy

This article was originally compiled by LCTT and launched with the honor of Linux in China

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.