PORT command for FTP

Source: Internet
Author: User
Think carefully about this conversation and we will find some interesting things. We can see that when the PORT command is submitted, it specifies a port on the client (192.168.150.80) instead of the server. When we use Passive FTP, we will see the opposite phenomenon. Let's take a look at the PORT command format. As you can see in the following example, it is a sequence consisting of six numbers separated by commas. The first four are IP addresses, and the last two are the port numbers used for data connection. Multiply the fifth number by 256 and add the sixth number to obtain the actual port number. In the following example, the port number is (14*256) + 178) = 3762. We can use netstat to verify the port information.

Testbox1: {/home/p-t/Slacker/public_html} % FTP-D testbox2
Connected to testbox2.slacksite.com.
220 testbox2.slacksite.com FTP server ready.
Name (testbox2: slacker): slacker
---> User slacker
331 Password required for slacker.
Password: tmppass
---> Pass xxxx
230 user slacker logged in.
---> Syst
215 UNIX type: l8
Remote system type is UNIX.
Using binary mode to transfer files.
Ftp> ls
FTP: setsockopt (ignored): Permission denied
---> Port 192,168,150, 178
200 PORT command successful.
---> List
150 opening ASCII mode data connection for file list.
Drwx ------ 3 slacker users 104 Jul 27 public_html
226 transfer complete.
Ftp> quit
---> Quit
221 goodbye.
 

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.