Microsoft KB Archive/247132

= How to perform a server-to-server FTP transfer by using IIS =

Article ID: 247132

Article Last Modified on 12/3/2007

-

APPLIES TO


 * Microsoft Internet Information Services 6.0
 * Microsoft Internet Information Services 5.0
 * Microsoft Internet Information Server 4.0

-



This article was previously published under Q247132



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



SUMMARY
This step-by-step article describes how to configure a computer that is running Microsoft Internet Information Services (IIS) to allow server-to-server FTP transfers by modifying values in the system registry.

Note By default, these values are disabled to prevent malicious attacks against the file transfer protocol (FTP) service. Although details for configuring server-to-server transfers are listed in this article, Microsoft does not recommend modifying these registry keys on IIS-based FTP servers that are connected to the Internet.

Requirements
The following list outlines the recommended hardware, software, network infrastructure, and service packs that are required:
 * Two computers that are running the IIS FTP Service, with the configured changes that are described in the "Server Configuration" section.
 * A third computer with the command-line FTP that is included with Microsoft Windows 95, Microsoft Windows 98, Microsoft Windows Millennium Edition (Me), Microsoft Windows NT, and Microsoft Windows 2000, or another FTP client that supports issuing literal FTP commands.

Server configuration
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

IIS 6.0
 On the server that initiates the data channel, set the following value in the registry to allow server-to-server FTP transfers when you issue commands from a client that is not located on either of the two FTP servers:

 On the second server, set the following value in the registry:



IIS 5.0
 Set the following value in the registry on both FTP servers to allow server-to-server FTP transfers when you issue commands from a client that is not located on either of the two FTP servers:

 Set the following value in the registry on the server that will issue the literal port command (Client1 in the example):

Note By default, this value does not exist in the registry, and it requires Windows 2000 Service Pack 1 (SP1) or later to be recognized.

IIS 4.0
 Set the following value in the registry on the server that will issue the literal port command (Client1 in the example) to allow server-to-server FTP transfers when you issue commands from a client that is not located on either of the two FTP servers:

</li> If you are using IIS 4.0 computers that are running Windows NT 4.0 Service Pack 6a or earlier, install the fix that is described in the following Microsoft Knowledge Base article to allow the EnablePortAttack registry key to function properly:

246173 FTP server does not allow FTP server-to-server connection

</li></ol>

Example
In typical client/server FTP transfers, the user is only responsible for sending "friendly" commands to the server; the client responds automatically. When a server-to-server FTP transfer is performed, another server is the client. Therefore, the user is responsible for sending all FTP commands to both servers (in RFC959 format, these are preceded by the "literal" keyword).

To transfer a binary file (named myFile.xls) from Server1 (IP address: 192.168.0.10) to Server2 (IP address: 192.168.1.20) by using the command-line FTP client on Workstation1, follow these steps:

Note You must have Write permissions enabled on Server2 for this example to work.  Connect to Server1 by using a command-line FTP client. (This connection will be referred to as Client1).</li> Connect to Server2 by using a command-line FTP client. (This connection will be referred to as Client2).</li> Issue the following command in Client2:

literal pasv

The response is as follows:

227 Entering Passive Mode (192,168,1,20,15,61)

Note that 15,61 represents the low and high order bytes of the port number (port 3901 in this case), which is randomly assigned with each FTP connection. As a result, the last two numbers of this string are different.</li> Issue the following command in Client1:

literal port 192,168,1,20,15,61

The response is as follows:

200 Port Command Successful

Use the IP and port string that is returned in step 3.</li> Issue the following command in both Client1 and Client2:

literal type i

The response is as follows:

200 Type set to I

</li> Issue the following command in Client1:

literal retr myFile.xls

The response is as follows:

125 Data Connection already open; Transfer Starting

</li> Issue the following command in Client2:

literal stor myFile.xls

The response is as follows:

Opening BINARY mode data connection for myFile.xls

</li> Continue to issue the following command on Client2 until you receive a 211 "No data connection" response message:

literal stat

This 211 response message is several lines long and indicates that the transfer is no longer in progress.</li></ol>

To transfer files from Server2 to Server1, issue the literal retr command from Client1 and the literal stor command from Client2.

<div class="moreinformation_section">

MORE INFORMATION
For more information about server-to-server FTP transfers in IIS 6.0, visit the following Microsoft TechNet Web site:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/38b012c0-442a-491c-aafc-c174b0048546.mspx

<div class="references_section">