Iis – FTP – IIS 7.5 – Stop / Deny Directory Listing

ftpiiswindows-server-2008

FTP site is hosted in IIS 7.5. Anonymous users are allowed. I want to restrict users to browse the directories in the FTP site and allow them only if they know the full path. Can it be achieved ? If so how?

Best Answer

Files and folders that are direct physical children of the FTP root can't be hidden. You could mark these files and folders as hidden in explorer, but that only prevents the most casual of browsers from seeing subfolders and files. It is still possible to override this using ls -a in the ftp client.

You can only control directory browsing of virtual directories in an IIS FTP 7.5 site. i.e. where you've right clicked on the site and added a virtual directory mapped to a folder not under the FTP site root:

enter image description here

They look like this when added:

enter image description here

To control their visibility open the directory browsing feature:

enter image description here

Uncheck the Virtual Directories directory listing option then click Apply:

enter image description here

There's also no support to control directory browsing in the FTP Extensibility hooks either which was another place I've looked at in the past.

If you need more fine grained level of control over your FTP site then you're going to have to replace IIS FTP with a more featured FTP server such as Filezilla (free) or Gene6 FTP (commercial) which is a product we use (it has a COM configuration API which is even callable from .NET apps via interop).