Shenyang customers asked us to provide the system with FTP functions and set the user and password. The following is a rough description of the Setting Process:
First, add the FTP component to the system. This is the basis for the next step. Next, modify the platform. reg file and add the following information:
[HKEY_LOCAL_MACHINE/comm/ftpd]
"Allowanonymous" = DWORD: 0; determines whether the server will allow anonymous access.
"Allowanonymousupload" = DWORD: 1; determines whether authorization is required to upload files to the server, delete files from the server, and rename files.
"Allowanonymousvroots" = DWORD: 1; Specifies whether access to virtual roots is granted or denied to anonymous users.
"Defaultdir" = "// hard disk // ftproot"; default root directory. directory and subdirectories of this key are accessible remotely. if this value is not set in the Registry, the default is/temp.
"Isenabled" = DWORD: 1; determines whether or not the server will accept incoming connections. This value is typically used to keep the Server Disabled at boot time.
"Useauthentication" = DWORD: 1; determines whether authorization is required to connect to the server. determines whether the client needs to send a user and pass pair before being allowed to issue other commands.
"Userlist" = ""
The above notes are clearly written about the settings here, msdn address: http://msdn2.microsoft.com/en-us/library/ms901310.aspx
After compiled NK is run, it cannot be accessed through FTP. Because we have not added users to the FTP server, it is a bit difficult to add users. You need to write some code by yourself. Some code is as follows:
Typedef bool (* pfnsetuser) (In maid, In maid );
Hdllmodule = loadlibrary (_ T ("NtLmSsp. dll "));
If (null = hdllmodule)
{
Return false;
}
Pfnsetuser = (pfnsetuser) getprocaddress (hdllmodule, _ T ("ntlmsetuserinfo "));
If (! Pfnsetuser)
{
Return false;
}
Return pfnsetuser (szname, szpwd );
With the above code, we can add users to the system. With a remote tool, we can see the loaded users in the system registry. Location: HKEY_LOCAL_MACHINE/comm/security/useraccounts.
However, if only the System user is added, the user is not authorized to access the FTP. when setting the FTP parameter in Reg, the last item is userlist. By the way, this is the place to add an FTP user. You can refer to the settings in the above msdn address, separate multiple users with semicolons (;), for example:
"Userlist" = "user1; user2"
At this point, you will find that we can finally log on to the FTP server with the added username. Through the above operations, the basic functions of the FTP server are complete.