Friday 21 March 2014

How to configure passive FTP in Windows server 2003:

How to configure passive FTP in Windows server 2003:

There are two types of FTP mode, Active and Passive, So here is question why passive mode required what is that?. Actually when FTP client connects to FTP server, there are two connections created, 1.Control Connection(tcp/20):used to transfer the commands and 2.Data connection(tcp/21): used to transfer the data and the process goes well.

So why the Passive mode is required: The passive mode is a solution if firewall/Router stops inbound connections, that means when server sends response to client the response drops at firewall and connections fails. but in passive mode client chose a random port greater than 1024 for control set and "control set port+1" for Data connection and both the port is opened by client from the inside of firewall, hence firewall does not have any objection and let the communication done. In active mode client sends PORT command to tell the server about port to use and map with tcp/20 and tcp/21, But in Passive mode client sends PASV command to tell the server that passive connection needs to built up, Hence server wait and respond to client given port and map it to tcp/20 and tcp/21.

Step to configure Passive mode in Server 2003:
1. Go to run command and type inetmgr.msc to open IIS management console.
2.Right Click on Local Computer--->Properties and select "Enable Direct Metabse Edit" check box.
3.open command prompt---cd c:\inetpub\AdminScripts---> Hit Enter.
4.Type the following command:cscript adsutil.vbs set /MSFTPSVC/PassivePortRange "5500-5700"
Below is the output of command:
C:\Inetpub\AdminScripts>cscript adsutil.vbs set /MSFTPSVC/PassivePortRange "5500-5700"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

PassivePortRange                : (STRING) ""5500-5700"

5. Now you have to open mentioned port in Windows firewall not in Network firewall.

Now you have passive FTP configured and working at your site.