Tips for configuring the Proftp service on the Linux System Platform

Source: Internet
Author: User
Article Title: Tips for configuring the Proftp service on the Linux system platform. 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.

Proftp:

1. Configure Ftp to allow Root login

Modify/etc/ftpusers and remove root

2. If you want to implement Ftp for the Root user, you can switch to the/directory.

Generally, you can only switch to your home directory and modify the/etc/proftpd. conf file in DefaultRoot

Add a row before a row

DefaultRoot/root

Restart the proftpd service.

Change Anonymous logon and do not want to log on to the default/var/ftp directory.

In the/etc/passwd file

Ftp: x: 14: 50: FTP User:/var/ftp:/sbin/nologin

The default directory in is changed.

3. If Ftp has the write function, change it to the <Global> section in the/etc/proftpd. conf file as follows:

     
      
           AllowAll
      
     

.

4. Change Ftp to PASV Mode

The setting in the Red Flag dc 5.0 is to add the following two statements in proftpd. conf.

MasqueradeAddress

# This parameter is set to the connection address that the server returns to the client when the client sends the pasv command,

# This address is usually the external address of the firewall (as the rdr address)

PassivePorts port number

After the settings, restart the ftp service.

FTP connections generally have two connections: one is the client and the server transmission command, and the other is the data transmission connection. FTP service programs generally support two different modes: Port mode and Port mode.

PasvMode: Let me first talk about the two different connection modes.

Assume that the client is C and the server is S.

* Port mode :*

After client C connects to server S, the Port mode is used, then client C will send a command to inform server S (client C opens a local port N waiting for you to connect to the data), when server S receives

After the Port command is run

Connect to the port N opened by the client. This data connection is generated.

* Pasv mode :*

After client C connects to server S, server S will send a message to client C. The message is (server S opens a local port M, So connect to me now ), after client C receives this message

The M port of service end S is connected. After the connection is successful, the data connection is also established.

In the above explanation, the two modes differ mainly in the establishment of data connections. For the Port mode, the client C opens a Port locally and waits for the server S to connect to establish a data connection; the Pasv mode is the server.

S open a port and wait for client C to establish a data connection.

There is a situation about the pasv mode of ftp:

If you use iptables to forward data to an intranet server, you can only use port mode by default. In this case, you can add two iptables modules to implement pasv mode:

Modprobe ip_conntrack_ftp

Modprobe ip_nat_ftp

Put it in/etc/rc. local. (Set on the gateway server or on the machine with iptables configured)

Of course, by modifying proftpd. conf. You can specify the allowed ports, but this limit indicates that the pasv port is fixed. If the number is 51000-510011, it can only be provided to a maximum of 11 users, otherwise, no port can be allocated. However, this problem does not occur when the module is loaded.

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.