IIS 6 Administration

I explained the new FTP User Isolation feature of IIS 6 earlier in this chapter, so let’s try it out here and see how it works. Create another new FTP site on your server. This time, when you get to the FTP User Isolation screen of the wizard, pause and examine the options presented (see Figure 9-9):

Figure 9-9: Enabling FTP User Isolation for a new FTP site

Let’s test this feature in a simple workgroup setting. First, create the following local user accounts on a stand-alone IIS machine using Local Users And Groups in Computer Management:

Now create the directory structure on your IIS machine as shown in Table 9-2.

Table -9.2: Directory Structure for Implementing FTP User Isolation

Directory

Description

C:\ftpstuff

Home directory for FTP site on which FTP User Isolation is enabled.

C:\ftpstuff\LocalUser

This directory must be created to contain user directories.

C:\ftpstuff\LocalUser\bsmith

Home directory for user Bob Smith, contains the file bob.txt.

C:\ftpstuff\LocalUser\tjones

Home directory for user Ted Jones, contains the file ted.txt.

C:\ftpstuff\LocalUser\atoklas

Home directory for user Alice B. Toklas, contains the file alice.txt.

C:\ftpstuff\LocalUser\Public

Home directory for anonymous users, contains the file pub.txt.

In addition to the physical directories outlined in Table 9-2, create a virtual directory for your FTP site, giving it the alias /shared and mapping it to the folder C:\shared on the server (the folder contains a file named shared.txt).

If FTP User Isolation works, then

I tested this in the following FTP session:

C:\>ftp 172.16.11.210 Connected to 172.16.11.210. 220 Microsoft FTP Service User (172.16.11.210:(none)): bsmith 331 Password required for bsmith. Password: 230 User bsmith logged in. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. bob.txt 226 Transfer complete. ftp: 9 bytes received in 0.00Seconds 9000.00Kbytes/sec.

Bob is obviously in his own home directory, so let’s see if he can move upward to the LocalUser directory to view the contents of other users’ home directories:

ftp> cd .. 250 CWD command successful. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. bob.txt 226 Transfer complete. ftp: 9 bytes received in 0.00Seconds 9000.00Kbytes/sec.

It didn’t work. Bob is still in his home directory. Clearly, users’ home directories are isolated from each other on this FTP site. Bob should be able to change to the /shared virtual directory. Let’s see if he can do so:

ftp> cd shared 250 CWD command successful. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. shared.txt 226 Transfer complete. ftp: 12 bytes received in 0.00Seconds 12000.00Kbytes/sec.

That worked. Let’s break out of Bob’s FTP session and start another session, this time for an anonymous user:

ftp> ! Microsoft Windows [Version 5.2.3678] (C) Copyright 1985-2002 Microsoft Corp. C:\>ftp 172.16.11.210 Connected to 172.16.11.210. 220 Microsoft FTP Service User (172.16.11.210:(none)): anonymous 331 Anonymous access allowed, send identity (e-mail name) as password. Password: 230 Anonymous user logged in. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for file list. pub.txt 226 Transfer complete. ftp: 9 bytes received in 0.00Seconds 9000.00Kbytes/sec.

As expected, anonymous users find themselves in the Public directory as their home directory. Further testing shows that anonymous users are restricted to this Public directory, except they can also access the /shared virtual directory.

Pretty cool!

Категории