The Objective is to setup, configure and test FTP server.
Setup Requirement:
Steps:
Firstly, make sure the FTP Publishing Service and IIS Admin Service are up. Use Windows 2000 Services snap in to verify this as shown below. Here we can confirm that the components are installed, started and ready to be configured.
Figure 1: The Services snap-in, verifying the IIS Admin and FTP Publishing Services status.
Next, open the Internet Information Services snap-in. Click Start → Program → Administrative Tools → Internet Services Manager. |
Figure 2: Invoking the FTP properties page through context menu.
Select and right click the Default FTP Site and select the Properties context menu. The following dialog box appears. Select your server IP Address, replace the Unassigned in the IP Address list box as shown below (your server IP address should be different). The default port for FTP is 21, you can change the default port, but the user need to know the port when connecting to this FTP server and make sure the port is not used by other services.
Figure 3: FTP Site properties page.
Next, select the Security Accounts tab. Here you can configure your FTP server to act as Anonymous FTP or authenticated FTP server. Anonymous FTP permit access to the FTP folder using Anonymous user name and mail address as password and the access is automatically granted. The account used is a built-in IUSR_YOUR_SERVER_NAME account. Authentication type means only authenticated user can access the FTP resources for downloading or uploading. In this lesson just set as shown below. We are going to set Anonymous FTP server, so no need user name or password. You can add other FTP Site Operators, the default is Administrators group.
-------------------------------------------------------------------------------------------
Figure 4: FTP Site’s Security Accounts page.
Next, click the Messages tab. Here you can set the Welcome messages, Exit message and maximum concurrent connection. An example is shown below.
Figure 5: FTP Site’s Messages page.
Next, click the Home Directory tab. Here you can set your home directory for your FTP service. The default is c:\inetpub\ftproot on local computer and you can also point to a shared directory on other computer. You can change to other directory whether local or remote by using the Browse button. In this lesson just use the default setting. Select the Read and Log visits tick box. It is clear here; if you provide the uploading service, select the Write tick box. Next, click the Directory Security tab.
Figure 6: FTP Site’s Home Directory page.
Here, you can grant and deny access based on the single client or a groups of client. In this lesson just grant all computer. Next click the OK button. Next, restart the FTP service or stop and start the service.
Figure 7: FTP Site’s Directory Security page.
Figure 8: The FTP site restriction setting (blocking).
Figure 9: Restarting the FTP service.
Next we are going to test our FTP server. Before that, copy a folder as a sample downloadable data and put it in the c:\inetpub\ftproot folder.
Figure 10: Copying a sample directory to the FTP directory for testing.
Then, launch the Internet browser and type the IP address and the port number (FQDN can be used if your DNS server is working and no need to put :21 because we already setup the FTP to use the default port) as shown below in the address bar of the browser and press the Enter key.
ftp://your_FTP_IP_address_or_FQDN/ or ftp://localhost/ or ftp://127.0.0.1/
Figure 11: Accessing an Anonymous FTP server.
Figure 12: Using a ftp://localhost to access FTP server.
Let test the authenticated FTP user. Go back to the FTP property page and click the Security Accounts tab. De-select the Allow Anonymous Connections tick box.
Figure 13: Setting the authenticated FTP access.
When the Internet Service Manager dialog prompt displayed, click the Yes button.
Figure 14: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.
Click the Browse button and select Administrator account. In real case, you should create and account just for the FTP access, do not use Administrator or other built-in high privileges Windows accounts.
Figure 15: Selecting the Administrator user account for the FTP access.
If required, deselect again the Allow Anonymous Connections tick box.
Figure 16: Dialog prompt for the unencrypted data transmission of the authenticated FTP access.
Try accessing your FTP server again; you should be welcome by the Login As window as shown below. Enter the Administrator account credential and click the Login button. Take note that, you may need to restart the FTP service because every time you change the FTP options, the FTP service must be restarted in order the changes take effect.
Figure 17: Accessing the FTP server that needs a username and password.
Figure 18: The authenticated access of FTP server.
You can also use the command line ftp commands. The following Table list the FTP command line summary for Windows.
Syntax: |
|
ftp [-v] [-d] [-i] [-n] [-g] [-s:FileName] [-a] [-w:WindowSize] [-A] [Host] |
|
|
|
Parameters |
|
-v |
Suppresses the display of FTP server responses. |
-d |
Enables debugging, displaying all commands passed between the FTP client and FTP server. |
-i |
Disables interactive prompting during multiple file transfers. |
-n |
Suppresses the ability to log on automatically when the initial connection is made. |
-g |
Disables file name globbing. Glob permits the use of the asterisk (*) and question mark (?) as wildcard characters in local file and path names. |
-s:FileName |
Specifies a text file that contains ftp commands. These commands run automatically after ftp starts. This parameter allows no spaces. Use this parameter instead of redirection (<). |
-a |
Specifies that any local interface can be used when binding the FTP data connection. |
-w:WindowSize |
Specifies the size of the transfer buffer. The default window size is 4096 bytes. |
-A |
Logs onto the FTP server as anonymous. |
Host |
Specifies the computer name, IP address, or IPv6 address of the FTP server to which to connect. The host name or address, if specified, must be the last parameter on the line. |
/? |
Displays help at the command prompt. |
|
|
Remarks
You must prefix ftp parameters with
a hyphen (-) rather than a slash (/). Ftp supports the use of IPv6 when the IPv6 protocol is installed. There are many more ftp sub commands such as ftp: mdir, ftp: mget, ftp: open, ftp: pwd etc. Type /? or ftp: help for more information. |
|
|
|
Examples
To log on to the FTP server named ftp.example.google.com, type the following command:
To anonymously log on to the FTP server named ftp.example.google.com, type the following command:
ftp -A ftp.example.google.com
To log on to the FTP server named ftp.example.google.com and run the ftp commands contained in a file named resynch.txt, type the following command:
ftp -s:resynch.txt ftp.example.google.com
|
-----------------End----------------
Further reading and digging:
MSDN MFC 9.0 class library online documentation - latest version.
DCOM at MSDN.
COM+ at MSDN.
COM at MSDN.
Unicode and Multi-byte character set: Story and program examples.