In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The account synchronization module is used to synchronize the account between the fortress machine and the application publisher.
1. Related software:
As shown in the figure above, there are four files divided into two parts, of which:
(1) ClientSocket.php and ClientTest.exe are client software that simulates the sending of account synchronization commands for testing services. For how to call the foreground, please refer to the function in the file ClientSocket.php.
(2) ServicInstall.msi and setup.exe are the installation files of account synchronization software.
2. ODBC data configuration:
Make sure that the ODBC source is configured locally, the data source name is "audit" and the database name is "audit_sec". If it is already configured, you can skip this step:
3. Install account synchronization software:
Copy the folder "Freesvr" to disk C, enter the folder, and double-click "setup.exe file" directly.
Note: double-clicking setup.exe will automatically check the dependent library. You may be prompted to install the .net4.0 client profile simplified Chinese language pack.
After installation, open the local service, and you can see the service named "AccountsSyncService". Restart the server to ensure that the program is available, as shown in the following figure
Restart the service:
4. Testing Service 4.1 testing with ClientText.exe
Double-click the ClientText.exe file in the folder, as shown in the following figure:
The program can handle a total of four commands:
Command 1: scan all tables and synchronize accounts; command format: async. This command will synchronize all accounts in the database table to the local place at once, and this command returns the result:
(1) successfully, the string is returned: "1, all accounts of the database have been successfully synchronized to the local!"
(2) failed. Return the string: "0, failed to synchronize all accounts of the database to local!"
Command 2: add the specified account; command format: async 1. This command will only add the specified username account locally. This command returns the result:
(1) if it is successful, the string is returned: "1, account added successfully!"
(2) failed. Return the string: "0, failed to add account!"
Command 3: disable the specified account; command format: async 2. This command will only disable the specified username account locally. This command returns the result:
(1) if it is successful, the string is returned: "1, account disabled successfully!"
(2) failed. Return the string: "0, failed to disable the account!"
Command 4: generate BHO configuration file; make format: async 3, this command is used to generate BHO configuration text, and this command returns the result:
(1) success: return the string: "1. The BHO configuration file was generated successfully, and the file is located in the directory:"
(2) failed: return the string: "0, failed to generate BHO configuration file!"
Note: in the returned string, the return codes 0 and 1 represent execution failure and success, and the corresponding information, separated by commas.
(1) Let's test command 2: add users
Enter the command: async 10.11.0.59 8888 adminTest 1
Command description: a total of five parameters, each parameter is separated by a space, 10.11.0.59 is the host IP where the synchronization service is installed, and the default port is 8888. If the port is configured in the configuration file, use the port in the configuration file!
This command will automatically add an account locally, but it will first query whether the account exists in the database and obtain the password of the account; if the acquisition fails, it will not be added; if it is successful, if the account is not available locally, it will be added. If so, re-enable it, and change the password to the password in the database.
Since the account, adminTest, does not exist in the database, the result is as above.
(2) Let's re-test command 1: scan all tables in the database and synchronize local accounts
Enter command: async 10.11.0.59 8888
Synchronization method: if you have it in the database, if you don't have it locally, create a new one; if you don't have it in the database, you can disable it locally; if you have it in the database, you can change the default password.
Before executing the command, the local accounts and groups are as follows:
After executing the command:
You will find that there are automatically more accounts in the database (I only read two records from the database for simple testing), and the rest of the accounts are disabled.
There is one more group freesvr:
At the same time, the account will be added to the remote login group.
(3) Let's test order 3 again.
Enter the command: async 10.11.0.59 8888 admin 2
Disable the user "admin"; the result is as follows:
It is found that the amdin account has been disabled (will the red cross be displayed immediately and need to be refreshed to see it, but if you look directly at the amdin attribute, you will find that it has been disabled)
(4) Let's test Command 2 again and add the account admin.
Enter the command: async 10.11.0.59 8888 admin 1
Because the account already exists in the database, determine whether the account exists locally, and if not, create a new one; if so, determine whether it is disabled, and re-enable it if it is disabled, otherwise only change the password.
Because it already exists locally, it will be re-enabled and the password will be changed.
You can see that the admin account has been re-enabled.
(5) Test order 4
Enter command: async 10.11.0.59 8888 3
After executing the synchronization command, the bho.xml file is automatically synchronized. The default directory of the file is "C:\ Freesvr\ BHO". If it is configured in the configuration file, the directory in the configuration file will be used. It is important to note that the configuration of this directory is the same as the directory of the configuration file in the BHO folder in the application release, so that the BHO hook can read the file:
4.2 testing with ClientSocket.php
There is only one function in the php file, which is used to send a request for account synchronization to the server, as shown in the following figure. For more information, please see the file:
Here is a brief presentation of the test results:
(1) Test Command 2 first
Execute the following functions:
Command 2 is to add the specified user, and execute the result:
If command 2 is changed to
Execution result: the addition failed because the account is not included in the database.
(2) Test Command 3:
Execute the following functions
Execution result:
Account disabled successfully!
Command 1 is not tested here, it has been tested with "ClientText.exe" before.
5. Modify the configuration file
The default installation directory for the account synchronization service is:
"C:\ Program Files\ Freesvr\ AccountsSyncService"
If the configuration file is modified, it will not take effect until the service is restarted. The contents of the configuration file are as follows: the first is the switch for the default password, which has two values: "ON" means to use the default password, and "OFF" means to use the password in the database.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.