Windows built-in FTP server advanced configuration

  
        

mentioned FTP server, you may think of Serv-U, vs-FTP and other software, in fact, Microsoft's built-in FTP service in IIS is enough, do not believe please look down.

Implementing management for multiple users

First need to cancel "Site Properties/Allow Anonymous Connection", as shown in Figure 1.


Then enter "Computer Management /Local Users and Groups", create a new group, here is established as FTPuser, then create a new user FTP01, then modify the properties of FTP01, add it FTPuser group, remove the default users group. Create folders FTP01 and FTP02 under NTFS format partition (here for d drive), and then set security permissions, as shown in Figure 2.


The same set of folder FTP02 permissions for FTP02 full control, of course, you can assign different permissions for different users according to the actual situation. Go back to the IIS Manager and select an FTP site "New /Virtual Directory /Next". Enter FTP01 at the alias, select "Next", select the FTP01 directory you just created, select "Next", and create a new virtual directory FTP02. The path points to the FTP02 directory. Note here that the alias and directory name and the user name must be exactly the same.

Test: Here is an example of IP 192.168.0.16, enter FTP://192.168.0.16, press Enter, prompt to enter the user and password, enter FTP01 and its password, enter smoothly, then enter It can only be the FTP01 virtual directory. You can upload a file and check it on the server to determine which directory it is placed in. Similarly, when you log in with FTP02, you enter the FTP02 directory. Users are restricted to their own directories and cannot enter other people's directories. Security is still guaranteed. If the user needs to be able to change the password by himself, then only when the user is created, the option shown in Figure 3 is not selected.

Select "User can't change password"

Tip:

How to modify FTP account password:

At the command prompt, type:

FTP 192.168.0.16

Enter username and password

Enter quota "site pswd old password new password"

Advantages of this method: combined with NTFS Permissions and disk quotas make it easy to manage multiple users.

The shortcomings of this method: Since the FTP user password is transmitted in the clear text on the network, it is not safe. Unfortunately, the built-in FTP service of IIS does not support SSL, which is not comparable to Serv. -U.

This is achieved by the principle of path resolution, which is a hidden function of MS-FTP. First create a folder in the root directory of the FTP site (here, the d drive), named tools. In the IIS Manager, create a virtual directory under the FTP site, named tools, and the path points to the "tool" under the f drive. table of Contents. Note that the virtual directory name here must match the folder name created under the site root directory.

Login in the client, you can't log in with FTP01 or FTP02 at this time, because they log in directly to the corresponding subdirectory under the root directory of the site, and can't go back to the root directory of the site, so only Can create another new user, here I created an FTP03 user, log in and found that in addition to the FTP01, FTP02 directory, there are other directories, but the FTP01, FTP02 directory permissions are set in front, so FTP03 can not access them, just Know the existence of these directories. Click on the tools directory and you will find that the "Tools" directory under the f drive of the server is automatically pointed to.

Advantages of this method: The link function is implemented without third-party tools, and is especially useful when multiple drives are available. If you want to link to a complete partition, create a folder in the root of the site with the same name and drive letter.

The disadvantage of this method: you need to create additional users, if users like FTP01 want to browse other disks.

Automatically update the FTP site directory and file list

Windows has a very useful command tree where you can show your talents. If the FTP site root directory is d, we just need to create a batch file with the following contents

tree /f /ad: >d:FTP.txt

then add a task plan, each Run once every hour. It is worth noting that advanced settings must be made after adding a task, as shown in Figure 4.


After setting this up, you can download the FTP.txt file to the local to check if there is any update, so you can save the user a directory and find the update time. Especially when the network speed is slow. To expand this, you can save more user time, or rely on another useful command fc of Windows, write the following batch file FTP update.bat:

tree /f /ad: >d: FTPnew.txt

fc /L d:FTP.txt d:FTPnew.txt >d:FTP update list.txt

Then run once to write FTP.bat and run again FTP update .bat, you can view the FTP update list.txt. If there is an update, it will indicate which directory has been updated in the form of ***** at the end of *****, and the updated file name is anything. Listed, is it more obvious? Users only need to download the FTP update list.txt to view it first. Of course, the user has already browsed the FTP site. The first time you browse and download FTP.txt, if the FTPnew.txt file should not appear in the site root directory. Underneath, you can also point to other locations when editing commands.

I also see a lot of FTP lists in the forum. Manual maintenance is very troublesome. Just put the FTP update list.txt in a web directory or specifically create a virtual directory to point to the FTP update list.txt directory. , then we can browse this file directly through the browser, because IE browser can directly parse the txt file, so it will not prompt for download. In order to better facilitate the viewer, the FTP update .bat can be supplemented. The complete FTP update.bat content is as follows:

tree /f /ad: >d:FTPnew.txt

Fc /L d:FTP.txt d:FTPnew.txt >d:FTP update list.txt

echo update time>> d:FTP update list.txt

date /t >> d: FTP update list.txt

time /t >> d:FTP update list.txt

Then add a scheduled task, execute this batch every hour The file is processed so that the viewer not only sees the updated content, but also knows when the update is made, and the next update time can also be calculated by himself. If you log in to this FTP site frequently, you can also add this address to your favorites. You can also know if the server is updated without logging in to FTP.

The tools mentioned above are all provided by Windows. There is no third-party tool used. In fact, there are still many places in Windows that are worthy of us.

Copyright © Windows knowledge All Rights Reserved