LinuxVSFTP configuration (1)

Source: Internet
Author: User
Article Title: linuxVSFTP configuration (1 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1 Overview of VSFTP

FTP, file transfer protocol, which is the communication protocol for file transfer and is also the most common method for transferring files. When using RedHat9, the reader may feel some changes to the ftp server: first, the ftp server only has vsftp left, and the original wuftp is not put in? Second, vsftp is isolated from XINETD and moved from/etc/vsftpd. conf to/etc/vsftpd. conf.

Why is this change? It can be seen that vsftp has the ability to operate independently and does not require XINETD for further management and control, such as sendmail, httpd, ssh, and samba, put the set file into an independent directory under/etc.

There are two types of FTP: port ftp, which is the common FTP? The other is PASVFTP, which is described as follows:

PORT FTP

This is a common form of FTP. First, a control channel is established. The default value is port 21, that is, it is established online with port 21 and commands are issued online. Second, the FTP server will establish a data transmission channel. The default value is 20, that is, it is established online with port 20, and data transmission is performed through port 20.

PASV FTP

Similar to port ftp, a control channel is established first. The default value is port 21, that is, port 21 is established online and commands are issued online. Second, the client will make a data transmission request, including the number of the data transmission port.

What are the differences between the two? The data transmission PORT in port FTP is specified by the FTP server, while the pasv ftp data transmission port is determined by the FTP client. We usually use pasv ftp to determine the data transmission port through communication between the client and the server in a firewall environment.

2. Example

1. Directly start the VSFTP Service

This example is a default example of applying RedHat to directly start vsftp.

[Root @ relay vsftpd] #/sbin/service vsftpd start

Starting vsftpd for vsftpd: OK]

2. Change port to provide service: Replace the default port 21 with 2121

For the sake of security, or to separate different ftp services by port, we may change the ftp port to a port other than 21, so refer to the following steps.

Step 1. Modify/etc/vsftpd. conf

Add the following line

Listen_port= 2121

Step2. restart vsftpd

[Root @ home vsftpd] #/sbin/service vsftpd restart

Shutting down vsftpd: OK]

Starting vsftpd for vsftpd: OK]

3. Specific users peter and john may not change Directories

The user's default directory is/home/username. If you do not want the user to switch to the previous directory/home during ftp, refer to the following steps.

Step 1. Modify/etc/vsftpd. conf

Set the following three lines

# Chroot_list_enable = YES

# (Default follows)

# Chroot_list_file =/etc/vsftpd. chroot_list

Change

Chroot_list_enable = YES

# (Default follows)

Chroot_list_file =/etc/vsftpd/chroot_list

Step 2: Add a file:/etc/vsftpd/chroot_list

Add two lines to the content:

Peter

John

Step3. restart vsftpd

[Root @ home vsftpd] #/sbin/service vsftpd restart

Shutting down vsftpd: OK]

Starting vsftpd for vsftpd: OK]

If peter wants to switch to a directory other than the root directory, the following warning will appear:

Ftp> cd/home

550 Failed to change directory.

4. Cancel anonymous Logon

If your host does not require anonymous user login, follow these steps.

Step 1. Modify/etc/vsftpd. conf

Set

Anonymous_enable = YES

Change

Anonymous_enable = NO

Step2. restart vsftpd

[Root @ home vsftpd] #/sbin/service vsftpd restart

Shutting down vsftpd: OK]

Starting vsftpd for vsftpd: OK]

[1] [2] [3] Next page

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.