FTP Service in Linux

Source: Internet
Author: User
Tags ftp client file transfer protocol

FTP Service

File Transfer Protocol

Ftpfile Transfer Protocol One of the early three application-level protocols

Based on C/s structure

Dual-channel protocol: Data and command connections

Data transfer format: binary (default) and text

Two modes: Server angle Active (port style): Server Active Connection active mode (port)--TCP three-time handshake

The FTP client first establishes a connection to the server's TCP 21 port, which is used to send a command that sends the port command on this channel when the client needs to receive data. The port command contains what ports the client uses to receive data. When transmitting data, the server connects to the client's specified port via its TCP 20 port to send the data. The FTP server must establish a new connection with the client to transfer the data.

As shown, the user host is directly exposed to the Internet and the user connects to the FTP server using the active mode to follow one of the following procedures:

User host a random port to connect to the FTP server's TCP21 port for negotiation;

User host to tell the FTP SERVER, my XXXX Port has been opened, you can be assured of daring to connect over;

The FTP server then connects the user host's XXXX port with the TCP20 port and the data transfer begins.

Passive Mode (PASV)--for TCP three-time handshake

Establish a control channel similar to standard mode, but send the PASV command after establishing a connection. After the server receives the PASV command, it opens a temporary port (with a port number greater than 1023 less than 65535) and notifies the client of the request to transmit data on this port, the client connects to this port on the FTP server, and the FTP server transmits the data through this port.

Many firewalls are not allowed to accept externally initiated connections when they are set up, so many FTP servers behind firewalls or intranet do not support PASV mode because clients cannot open the high-end port of the FTP server through the firewall, and many intranet clients cannot log on to the FTP server using port mode. Because TCP 20 from the server cannot establish a new connection to the internal network client, it does not work.

When the user host front-end more than a firewall (client use address translation access to the Internet), things become more complex, first, the active mode is the FTP server connection client, the firewall is definitely not dry, even if willing to dry the client and the server to negotiate the XXXX port is also a random port, You let the confusion of the firewall situation, then need to use the Client software Passive mode active Connection Firewall, so that the appetite of the firewall.

The client uses passive mode to follow these procedures:

First, the user uses a random port to connect to the FTP server TCP 21 port for negotiation;

FTP server tells the client: my XXXX port is open, you have to come over it;

The client uses a random port to connect to the XXXX port of the FTP server to transmit data.

Example of a server passive mode data port:

227 Entering Passive Mode (192,168,175,138,224,59)

The server data port is: 224*256+59

FTP Software Introduction FTP server:

Wu-ftpd,proftpd,pureftpd,servu,iis

Vsftpd:very Secure FTP daemon,centos default FTP server

High speed, stable, download speed is twice times of wu-ftp

Ftp.redhat.com Data: Single machine supports up to 15,000 concurrent

Client software:
FTP,LFTP,LFTPGET,WGET,CURLFTP-A ftpserver port-a Active mode –p Passive mode lftp–u username ftpserverlftp [email protected]lftpget ftp:  Gftp:gui centos5 Latest Version 2.0.19 (11/30/2008) filezilla,cuteftp,flashfxp,leapftpie ftp://username:[email Protected]
FTP Service Status Code:
1XX: Information 125: Data connection Open 2XX: Success class Status 200: Command OK 230: Login Success 3XX: Supplemental class 331: User name ok4xx: Client Error 425: Cannot Open data connection 5XX: Server error 530: cannot log on
User authentication:
Anonymous User: ftp,anonymous, corresponding to Linux user FTP system User: Linux user, user/etc/passwd, password/etc/shadow virtual User: Dedicated user for specific service, independent user/password file Nsswitch: Network Service Switch name resolution Framework pam:pluggable Authentication Module user authentication/lib64/security/etc/pam.d//etc/pam.conf

FTP Service in Linux

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.