Serv-U is an FTP server program (users can download it from the www.serv-u.com website), which can run on Windows 95/98/2000/Me/XP and Windows NT 4.0 operating systems. It can configure the user's computer to An FTP server. Other computers on the network can copy, move, create or delete files and directories by connecting to the FTP server.
10.3.1 Install Serv-U and establish FTP server
After downloading the Serv-U application, execute ServU4004.exe and install it step by step according to the prompts. After the installation is completed, there is no need to restart the computer. Users can directly select the "Start" → "Programs" → "Serv-U FTP Server" → "Serv-U Administrator" command to start the application and perform simple settings. Let's take the current computer (IP address 192.168.0.1, domain name server.kangbo.com) as an example to establish an FTP server.
The steps to establish an FTP server are as follows:
(1) Start the Serv-U program and open the Serv-U Administrator window. The Setup Wizard dialog box will be displayed, as shown in Figure 10-13. This dialog box makes it easy to complete basic settings.
Figure 10-13 Setup Wizard dialog box
(2) Click the Next button to open the Show menu images dialog box, select the Yes radio button, and you can use small icons when using menu items.
(3) Click the Next button to open the Your IP address dialog box, and enter the server's IP address in the IP address text box, such as 192.168.0.1.
(4) Click the Next button to open the Domain name dialog box, and enter the domain name in the Domain name text box, such as server.kangbo.com.
(5) Click the Next button to open the Anonymous account dialog box and select the Yes radio button to allow users to access the directory anonymously.
(6) Click the Next button to open the Home directory dialog box, and enter the home directory where the anonymous user logs in, such as C:MyFTP, in the Anonymous home directory text box.
(7) Click the Next button to open the Lock in home directory dialog box, select the Yes radio button to lock the directory for anonymous access. In this way, users who log in anonymously will only be able to access files and folders in the home directory, and other files and folders outside this directory will not be accessible.
(8) Click the Next button to open the Named account dialog box, select the Yes radio button, and create a named account so that users can access FTP with a specific account.
(9) Click the Next button to open the Account name dialog box, and enter the name of the account to be created in the Account login name text box, such as wang.
(10) Click the Next button to open the Account Password dialog box and enter the password in the Password text box, such as wang.
(11) Click the Next button to open the Home directory dialog box. Enter the name of the login directory in the Home directory text box, which is the same as the content entered in step (6), such as C:MyFTP.
(12) Click the Next button to open the Lock in home directory dialog box and select the No radio button to not lock the home directory.
(13) Click the Next button to open the Admin privilege dialog box, and select administrator privileges in the Account admin privilege drop-down list box. Here we select system administrator permissions, namely System Administrator.
(14) Click the Next button to open the Done dialog box. If you need to modify the previous settings, click the Previous button; if you want to retain the settings, click the Finish button. At this time, the Serv-U administrator window is shown in Figure 10-14.
Figure 10-14 Administrator window after configuring the site
10.3.2 Create a group
In the Serv-U Administrator window, expand the created FTP server node, right-click the Groups node, and select the New Group command from the pop-up shortcut menu to create a group. The Add new group dialog box will open. Enter the group name, such as Wd, in the Group name text box, and then click the Finish button. The created group will be displayed in the administrator window.
Select the Dir Access tab and click the Add button to open the Add file/path to access rules dialog box. Set the file path, such as C:MyFTP, and the permissions this group has on the folder, as shown in Figure 10-15.
Figure 10-15 Create a group and set the file path
10.3.3 Create a virtual directory
For the anonymous user (Anonymous), his home directory is C:MyFTP. If you want to access the content in C:Wang through the format of ftp://192.168.0.1/temp, you need to add a virtual directory for it. .
The steps to create a virtual directory are as follows:
(1) In the Serv-U administrator window, click the Settings node under the server node and select the General tab.
(2) Click the Add button to open the Virtual path mappings-step 1 dialog box, and enter the physical path in the Physical path text box, such as C:MyFTP.
(3) Click the Next button to open the Virtual path mappings-step 2 dialog box, and enter the directory name to which the path is mapped in the Map physical path to text box, such as C:Wang.
(4) Click the Next button to open the Virtual path mappings-step 3 dialog box. In the Map path name text box, enter the virtual directory name, such as temp.
(5) Click the Finish button to complete the creation of the virtual directory. The result is shown in Figure 10-16.
Figure 10-16 Creating a virtual directory
(6) Select the Anonymous user in the left pane of the manager, switch to the Dir Access tab in the right pane, and then click the Add button to add the C:Wang directory to the list.
10.3.4 Managing FTP users
When creating the server site using the Serv-U administrator, we have created an Anonymous user and a wang user. Administrators can also add, delete, copy or disable users as needed.
● To add a new user, including adding an Anonymous user, right-click the Users node in the left pane of the administrator window. The shortcut menu pops up, select the New User command, and open the Add new user dialog box. Follow the prompts and enter the user name, password and home directory in sequence.
● To delete a user, right-click the selected user and select the Delete User command from the pop-up shortcut menu.
● To copy a user, right-click the selected user and select the Copy User command from the pop-up shortcut menu. A new user will be generated (its name is Copy of before the original user name). Except that the user name is different from the original user, other items (including password, home directory, directory permissions, etc.) are completely the same.
● To temporarily disable a user's login rights, select the user, switch to the Account tab, and enable the Disable account check box. 10.3.5 Managing directory permissions
Select the user name in the left pane of the Serv-U administrator window, and then switch the right pane to the Dir Access tab. After selecting the directory in the list, you can change the current user's access rights on the right side of the window. The settings are shown in Figure 10-17.
Figure 10-17 Setting access permissions
Access permissions are divided into 3 categories, namely file, directory and subdirectory permissions. Among them, file permissions include Read, Write, Append, Delete and Execute; directory permissions include List, Create and Remove; subdirectory permissions only include Inherit. When the corresponding check box is enabled, the set permissions will take effect on the current directory and the entire directory tree below it.
10.3.6 Client connection
On the client side, users can connect to the configured FTP server through various methods such as DOS mode, IE browser or dedicated FTP client application.
● In DOS (or command prompt) state, the client's access format is ftp -A 192.168.0.1. You can log in anonymously without entering a user name and password.
● In the IE browser, the client access format is ftp://192.168.0.1, and there is no need to enter the user name and password.
● In the dedicated FTP client application settings, such as CuteFTP Version 4.2 Chinese version, as shown in Figure 10-18, enter the site label name (any) in the "Site Label" text box; in the "Host Address" text Enter the FTP server site address 192.168.0.1 in the box; enter the user name and password in the "User ID" and "Password" text boxes respectively. Then click the "OK" button.
Note:
In the client connection, the IP address 192.168.0.1 can also be replaced by the computer name server.kangbo.com. In DOS mode, except that A in ftp -A 192.168.0.1 must be capitalized, other characters are not case-sensitive. If you use ftp 192.168.0.1 format to log in in DOS mode, you need to enter the login username and password.
Figure 10-18 Log in to the server using FTP client software