问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

ftp文件夹错误

发布网友 发布时间:2022-04-30 00:57

我来回答

5个回答

热心网友 时间:2022-06-27 15:40

试试下列方法:

1使用FTP工具访问,如FlashFTP等。
2使用网际快车,迅雷等下载工具的FTP资源探测器访问。
3在“我的电脑”地址栏中打入以下格式 FTP://用户名:密码@IP地址,然后回车,就可以访问了
4可以添加到网上邻居。打开网上邻居,然后选添加一个网上邻居,按照提示填完就行了,下次可直接从网上邻居访问FTP了。

热心网友 时间:2022-06-27 15:41

[size=18]Active FTP vs. Passive FTP, a Definitive Explanation[/size]
[size=15]Contents:[/size]
[list]
[*]Introction
[*]The Basics
[*]Active FTP
[*]Active FTP Example
[*]Passive FTP
[*]Passive FTP Example
[*]Summary
[*]References
[*]Appendix 1: Configuration of Common FTP Servers[/list]

[size=15]Introction[/size]

One of the most commonly seen questions when dealing with firewalls and other Internet connectivity issues is the difference between active and passive FTP and how best to support either or both of them. Hopefully the following text will help to clear up some of the confusion over how to support FTP in a firewalled environment.

This may not be the definitive explanation, as the title claims, however, I've heard enough good feedback and seen this document linked in enough places to know that quite a few people have found it to be useful. I am always looking for ways to improve things though, and if you find something that is not quite clear or needs more explanation, please let me know! Recent additions to this document include the examples of both active and passive command line FTP sessions. These session examples should help make things a bit clearer. They also provide a nice picture into what goes on behind the scenes ring an FTP session. Now, on to the information...

[size=15]The Basics[/size]

FTP is a TCP based service exclusively. There is no UDP component to FTP. FTP is an unusual service in that it utilizes two ports, a 'data' port and a 'command' port (also known as the control port). Traditionally these are port 21 for the command port and port 20 for the data port. The confusion begins however, when we find that depending on the mode, the data port is not always on port 20.

[size=15]Active FTP[/size]

In active mode FTP the client connects from a random unprivileged port (N >; 1024) to the FTP server's command port, port 21. Then, the client starts listening to port N+1 and sends the FTP command PORT N+1 to the FTP server. The server will then connect back to the client's specified data port from its local data port, which is port 20.

From the server-side firewall's standpoint, to support active mode FTP the following communication channels need to be opened:

[list]
[*]FTP server's port 21 from anywhere (Client initiates connection)
[*]FTP server's port 21 to ports >; 1024 (Server responds to client's control port)
[*]FTP server's port 20 to ports >; 1024 (Server initiates data connection to client's data port)
[*]FTP server's port 20 from ports >; 1024 (Client sends ACKs to server's data port)[/list]

When drawn out, the connection appears as follows:

In step 1, the client's command port contacts the server's command port and sends the command PORT 1027. The server then sends an ACK back to the client's command port in step 2. In step 3 the server initiates a connection on its local data port to the data port the client specified earlier. Finally, the client sends an ACK back as shown in step 4.

The main problem with active mode FTP actually falls on the client side. The FTP client doesn't make the actual connection to the data port of the server--it simply tells the server what port it is listening on and the server connects back to the specified port on the client. From the client side firewall this appears to be an outside system initiating a connection to an internal client--something that is usually blocked.

[size=15]Active FTP Example[/size]

Below is an actual example of an active FTP session. The only things that have been changed are the server names, IP addresses, and user names. In this example an FTP session is initiated from testbox1.slacksite.com (192.168.150.80), a linux box running the standard FTP command line client, to testbox2.slacksite.com (192.168.150.90), a linux box running ProFTPd 1.2.2RC2. The debugging (-d) flag is used with the FTP client to show what is going on behind the scenes. Everything in red is the debugging output which shows the actual FTP commands being sent to the server and the responses generated from those commands. Normal server output is shown in black, and user input is in bold.

There are a few interesting things to consider about this dialog. Notice that when the PORT command is issued, it specifies a port on the client (192.168.150.80) system, rather than the server. We will see the opposite behavior when we use passive FTP. While we are on the subject, a quick note about the format of the PORT command. As you can see in the example below it is formatted as a series of six numbers separated by commas. The first four octets are the IP address while the second two octets comprise the port that will be used for the data connection. To find the actual port multiply the fifth octet by 256 and then add the sixth octet to the total. Thus in the example below the port number is ( (14*256) + 178), or 3762. A quick check with netstat should confirm this 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
[color=#FF0000]--->; USER slacker[/color]
331 Password required for slacker.
Password: TmpPass
[color=#FF0000]--->; PASS XXXX[/color]
230 User slacker logged in.
[color=#FF0000]--->; SYST
215 UNIX Type: L8[/color]
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>; ls
[color=#FF0000]ftp: setsockopt (ignored): Permission denied
--->; PORT 192,168,150,80,14,178[/color]
200 PORT command successful.
[color=#FF0000]--->; LIST[/color]
150 Opening ASCII mode data connection for file list.
drwx------ 3 slacker users 104 Jul 27 01:45 public_html
226 Transfer complete.
ftp>; quit
[color=#FF0000]--->; QUIT[/color]
221 Goodbye.

[size=15]
Passive FTP[/size]

In order to resolve the issue of the server initiating the connection to the client a different method for FTP connections was developed. This was known as passive mode, or PASV, after the command used by the client to tell the server it is in passive mode.

In passive mode FTP the client initiates both connections to the server, solving the problem of firewalls filtering the incoming data port connection to the client from the server. When opening an FTP connection, the client opens two random unprivileged ports locally (N >; 1024 and N+1). The first port contacts the server on port 21, but instead of then issuing a PORT command and allowing the server to connect back to its data port, the client will issue the PASV command. The result of this is that the server then opens a random unprivileged port (P >; 1024) and sends the PORT P command back to the client. The client then initiates the connection from port N+1 to port P on the server to transfer data.

From the server-side firewall's standpoint, to support passive mode FTP the following communication channels need to be opened:

[list]
[*]FTP server's port 21 from anywhere (Client initiates connection)
[*]FTP server's port 21 to ports >; 1024 (Server responds to client's control port)
[*]FTP server's ports >; 1024 from anywhere (Client initiates data connection to random port specified by server)
[*]FTP server's ports >; 1024 to remote ports >; 1024 (Server sends ACKs (and data) to client's data port)[/list]

When drawn, a passive mode FTP connection looks like this:

In step 1, the client contacts the server on the command port and issues the PASV command. The server then replies in step 2 with PORT 2024, telling the client which port it is listening to for the data connection. In step 3 the client then initiates the data connection from its data port to the specified server data port. Finally, the server sends back an ACK in step 4 to the client's data port.

While passive mode FTP solves many of the problems from the client side, it opens up a whole range of problems on the server side. The biggest issue is the need to allow any remote connection to high numbered ports on the server. Fortunately, many FTP daemons, including the popular WU-FTPD allow the administrator to specify a range of ports which the FTP server will use. See Appendix 1 for more information.

The second issue involves supporting and troubleshooting clients which do (or do not) support passive mode. As an example, the command line FTP utility provided with Solaris does not support passive mode, necessitating a third-party FTP client, such as ncftp.

With the massive popularity of the World Wide Web, many people prefer to use their web browser as an FTP client. Most browsers only support passive mode when accessing ftp:// URLs. This can either be good or bad depending on what the servers and firewalls are configured to support.

[size=15]Passive FTP Example[/size]

Below is an actual example of a passive FTP session. The only things that have been changed are the server names, IP addresses, and user names. In this example an FTP session is initiated from testbox1.slacksite.com (192.168.150.80), a linux box running the standard FTP command line client, to testbox2.slacksite.com (192.168.150.90), a linux box running ProFTPd 1.2.2RC2. The debugging (-d) flag is used with the FTP client to show what is going on behind the scenes. Everything in red is the debugging output which shows the actual FTP commands being sent to the server and the responses generated from those commands. Normal server output is shown in black, and user input is in bold.

Notice the difference in the PORT command in this example as opposed to the active FTP example. Here, we see a port being opened on the server (192.168.150.90) system, rather than the client. See the discussion about the format of the PORT command above, in the Active FTP Example section.

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
[color=#FF0000]--->; USER slacker[/color]
331 Password required for slacker.
Password: TmpPass
[color=#FF0000]--->; PASS XXXX[/color]
230 User slacker logged in.
[color=#FF0000]--->; SYST
215 UNIX Type: L8[/color]
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>; passive
Passive mode on.
ftp>; ls
[color=#FF0000]ftp: setsockopt (ignored): Permission denied[/color]
[color=#FF0000]--->; PASV[/color]
227 Entering Passive Mode (192,168,150,90,195,149).
[color=#FF0000]--->; LIST[/color]
150 Opening ASCII mode data connection for file list
drwx------ 3 slacker users 104 Jul 27 01:45 public_html
226 Transfer complete.
ftp>; quit
[color=#FF0000]--->; QUIT[/color]
221 Goodbye.

[size=15]Summary[/size]

The following chart should help admins remember how each FTP mode works:

Active FTP :
command : client >;1024 ->; server 21
data : client >;1024 <- server 20

Passive FTP :
command : client >;1024 ->; server 21
data : client >;1024 ->; server >;1024

A quick summary of the pros and cons of active vs. passive FTP is also in order:

Active FTP is beneficial to the FTP server admin, but detrimental to the client side admin. The FTP server attempts to make connections to random high ports on the client, which would almost certainly be blocked by a firewall on the client side. Passive FTP is beneficial to the client, but detrimental to the FTP server admin. The client will make both connections to the server, but one of them will be to a random high port, which would almost certainly be blocked by a firewall on the server side.

Luckily, there is somewhat of a compromise. Since admins running FTP servers will need to make their servers accessible to the greatest number of clients, they will almost certainly need to support passive FTP. The exposure of high level ports on the server can be minimized by specifying a limited port range for the FTP server to use. Thus, everything except for this range of ports can be firewalled on the server side. While this doesn't eliminate all risk to the server, it decreases it tremendously. See [u][url=http://slacksite.com/other/ftp-appendix1.html]Appendix 1[/u]for more information.
[size=15]
References[/size]

An excellent reference on how various internet protocols work and the issues involved in firewalling them can be found in the O'Reilly and Associates book, Building Internet Firewalls, 2nd Ed, by Brent Chapman and Elizabeth Zwicky.

Finally, the definitive reference on FTP would be RFC 959, which sets forth the official specifications of the FTP protocol. RFCs can be downloaded from numerous locations, including [u]ftp://nic.merit.e/documents/rfc/rfc0959.txt[/u].

热心网友 时间:2022-06-27 15:41

你是本地服务器吗? 看提示似乎是远端服务器吧

貌似是那边服务器故障

热心网友 时间:2022-06-27 15:42

服务器的连接被重置,检查一下防火墙设置,是不是阻止了,或者服务器正在维护

热心网友 时间:2022-06-27 15:42

多半是用户名和密码不对,被服务器踢出来了
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
ef英语哪个好 EF英孚英语培训怎么样? 英孚英语好不好 EF英孚教育到底好不好 大佬们,麦芒7和荣耀10那个值得入手?2500以下的机子还有啥好推荐的么... 介绍几款2500元以前的手机 像素一定要高 其他的不做要求 近期想入手一部安卓手机,价格2200到2500左右…买HTC desire Z还是 三星... 笔记本忘记开机密码怎么办急死了 笔记本电脑屏幕开机锁忘记密码 怎么办?急死了 华硕笔记本电脑开机密码忘记了怎样找回?系统是Windows 7旗舰版... FTP出现错误打不开怎么办?... we和ftp有什么不同,包括服务器以及其对应的网址 weftp 是什么意思啊 公司章程里面的认缴期限是什么意思? 注册资本认缴最长年限 认缴出资时间最长多久 建筑专业毕业的,想考二级建造师,需要几年工作经验呢? 二级建造师是不是非得是建筑专业的才能报考吗? 大学本科生读建筑学(还没拿到文凭)有高中毕业证,可以考二级建筑师,二级建造师吗? 电大一年制中专建筑专业可以考二建吗 考二级建筑师需要什么条件! 建筑专业专科毕业,几年后可以考二级建筑师? 我建筑学本科毕业,没有学位,几年能考二级注册建筑师 建筑专业能报考水利水电二级建造师吗? 老师,职高毕业学的建筑专业可以考二级建造师吗? 中专是建筑专业,大专是烹饪专业能考二建吗? 技校文凭,专业建筑类,可以报考二建吗? 只要是建筑专业的都能报考二级建造师证吗 我是建筑学专业的,刚毕业能考二级建造师证吗? 9522486是不是水滴保平台的号码- 问一问 为什么我用FTP登陆记忆卡里面的文件夹是空的?(已解决,内付方法) VB.net连接FTP操作 有一首歌*部分是we will ...we will...we will win... WE8最新下载网站,要能玩的!!! 谁来推荐好听的歌? 小天才电话手表怎么解散群 金山词霸语音包 我要在网站上更改图片 用Dreamweaver修改 然后用FTP上传 怎么操作?_百... win服务器上怎么用git替代ftp 毛慈菇和白芨是一个东西吗? 如何用Qt连接数据库并导入文件 毛慈菇可以连茬种植吗 毛慈菇冬天会死吗? 山慈菇的介绍 山慈姑 毛慈姑 光慈姑的区别是什么呀?拜托各位大神 山慈菇一次服用量是几克、药性有没有副作用和毒性能不能长期内服_百度... 中药山慈菇有什么功效 山慈菇的妙用? 山慈姑有什么作用? 山慈菇药理作用