Build a Linux vsFTPd Server

Source: Internet
Author: User

1. Introduction to vsftpd

VsFTPd is one of the most popular FTP server programs in the Linux release. It features little, light, and secure and easy to use. It can give full play to and master its own characteristics, however, the most important part is the use. Currently, the FTPD suites commonly used in open-source operating systems include ProFTPD, PureFTPd, and wuftpd. Which FTP server suite is better, which is the most familiar and the best.

Ii. Two working modes of vsftpd

FTP connections generally have two connections. One is used for client and server transmission commands, and the other is used for data transmission connections. FTP service programs generally support two different modes: Port Mode and Pasv Mode ), let me first talk about the two different connection modes. (Assume that the client is C and the server is S)

Active Mode: The command connection is established by the random Port of client C Requesting the connection from TCP Port 21 of server S; the data connection is established by: (the command port connection is established after the connection is successful) client C will send a command to inform server S (client C opens a random Port N locally waiting for you to connect to the data). When server S receives the Port command, the random port N opened by the client through TCP port 20 of server S will be used to request the connection, and the connection is successful.

Pasv Mode: The command connection is also created by the random port of client C requesting a connection from TCP port 21 of server S. (The command port connection is established after the connection is successful) server S will send a message to client C. The message content is (server S opens a high port M locally. Please connect to me now ), after receiving this information, client C uses the random port of the client to connect to the M Port of server S, and the data connection is established successfully.

Iii. vsftpd installation and startup

The Vsftpd installer is in the Server directory of the RHEL5 installation CD, and the name is vsftpd-* (Version). rpm. Before installation, you can check whether your server has been installed. For example:

# Rpm-qa | grep vsftpd

Vsftpd-2.0.5-10.e15

If the vsftpd package is not installed on your server, run the following command to install it:

# Rpm-ivh vsftp-2.0.5-10.e15.i386.rpm

After your vsftpd package is installed, you can set the vsftpd service to automatically start when it is started. The command is as follows:

# Chkconfig vsftpd on

And set to start the service manually. The command is as follows:

# Service vsftpd start or #/etc/init. d/vsftpd start

Iv. vsftpd users

Vsftpd supports logon to ftp servers by anonymous users, local users, and virtual users.

In text mode, anonymous users must use the user name ftp, and the password is also ftp for login. If FTP is used for anonymous login, both the user name and password are: anonymous. By default, anonymous users can access and download files, but cannot upload, delete, create directories, and execute files! By default, anonymous users can access the/var/ftp directory after logon.

A local user is a user created by using useradd. The user information is stored in the/etc/passwd and/etc/shadow files. When the vsftpd client uses the identity and password of a local user to log on to vsftpd, the local user's home directory (Home Directory) is accessed by default ). (Note: to improve the security of the vsftpd server, we can set the shell of some local vsftpd users to/sbin/nologin, indicating that these users cannot log on to the system locally, however, you can use ftp to access information on the server)

Virtual User: multiple user names entered when the client logs on to the vsftpd Server do not exist on the server. These user names correspond to the local user on the vsftpd server. Therefore, when these virtual users log on, they will see the same home directory (that is, the home directory of the corresponding local user ). This improves the installation of vsftpd.

V. vsftpd configuration file:

Configuration files related to Vsftpd include:/etc/vsftpd. conf,/etc/vsftpd/ftpusers, and/etc/vsftpd/user_list. Among them,/etc/vsftpd/ftpusers is the ftp blacklist file, that is, the user names stored in this file are not allowed to access vsftpd;/etc/vsftpd. conf is the main configuration file of vsftpd;/etc/vsftpd/user_list file is more flexible, it is based on vsftpd. different configurations of the conf main configuration file can act as a blacklist file (default) or a white name file (that is, only the user name stored in the file can access vsftpd ), for more information about the settings, see this document.

Settings of the Vsftpd main configuration file/etc/vsftpd. conf:

Anonymous_enable = YES allows anonymous users

Anon_upload_enable = YES allows anonymous users to upload data

Anon_mkdir_write_enable = YES allows anonymous users to create directories and write data into new directories.

Anon_world_readable_only = NO allows anonymous users to browse existing data in a directory

Anon_other_write_enable = YES allows anonymous modification and deletion of Files

Anon_umask = 022 set the default permission for anonymous users to upload data

Anon_max_rate = 81920 maximum transmission speed for anonymous users (80 K/s)

Local_enable = YES allow local users

Recommended reading:

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

Case study of vsftpd Security Configuration

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.