Remote operation and maintenance method and computer readable storage medium
By mapping ports on the bastion machine and forwarding data through the agent, the problem of difficulty in remote viewing and locating faults for operation and maintenance personnel is solved, safe, reliable, and efficient remote operation and maintenance is achieved, and the necessity for on-site inspections is reduced.
Patent Information
- Application Number
- CN202410619507.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-20
AI Technical Summary
In complex organizations, it is difficult for operation and maintenance personnel to visually view and analyze server and terminal logs remotely to locate faults, and on-site inspections are time-consuming and laborious.
By establishing a communication connection on the bastion machine, parsing the viewing request of the operation and maintenance side, mapping the local port to the encrypted communication port of the target server, and forwarding the operation and maintenance data by proxy, remote operation and maintenance operations of the operation and maintenance side are realized without opening sensitive ports or having root. permissions.
This enables operation and maintenance personnel to locate faults without on-site inspections, improves operation and maintenance efficiency, ensures the safety and reliability of the bastion machine, and provides an efficient remote operation and maintenance solution.
Smart Images

Figure CN118214637B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of operation and maintenance technology, and in particular, relates to a remote operation and maintenance method and a computer-readable storage medium. Background Art
[0002] In a complex organization, such as a hotel or enterprise, a server is usually deployed locally. The server and local terminals (such as set-top boxes, smart all-in-one machines, etc.) are in a local area network. The local terminal requests the server to obtain pages and data through HTTP or HTTPS protocols for presentation to users. For security reasons, the server will not expose service ports to the public network, but will only provide operation and maintenance login ports, and will limit login to one or several bastion machines through security measures such as IP whitelists and key restrictions.
[0003] However, when a program on a project fails and needs to be troubleshooted, it is not intuitive and inconvenient to rely on operation and maintenance personnel to remotely log in to view the server and terminal logs and analyze the errors in the logs to locate the fault. If a project inspection is conducted to view the page displayed on the terminal, it is necessary to rely on people to actually check it on site, which is time-consuming and laborious. How to achieve operation and maintenance operations remotely is a technical problem that technicians in this field need to solve urgently.
[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the invention
[0005] Based on this, it is necessary to propose a remote operation and maintenance method and a computer-readable storage medium to address the above problems, which can realize remote operation and maintenance safely and effectively.
[0006] The present application solves the technical problem by adopting the following technical solutions:
[0007] The present application provides a remote operation and maintenance method, which is applied to a bastion host, wherein the bastion host is connected to a server in a local area network, the local area network includes a server and a local terminal, a communication connection is established between the server and the local terminal, and the bastion host also establishes a communication connection with an operation and maintenance end; the method includes the following steps: when a viewing request sent by the operation and maintenance end is obtained, the viewing request is parsed to determine a target server; the local port of the bastion host is mapped to an encrypted communication port of the target server; the operation and maintenance data is obtained from the target server through the mapped encrypted communication port by the viewing request, and the data is fed back to the operation and maintenance end; when the operation and maintenance is completed, the mapping between the local port of the bastion host and the encrypted communication port of the target server is released.
[0008] In an optional embodiment of the present application, when a viewing request sent by the operation and maintenance end is obtained, the viewing request is parsed to determine the target server, including: receiving the viewing request through an HTTP service program; parsing the viewing request to obtain the target server domain name, and determining the target server based on the target server domain name.
[0009] In an optional embodiment of the present application, parsing a viewing request to determine a target server includes: determining whether one has login authority to the target server; when one does not have login authority to the target server, determining a secure bastion host that has login authority; establishing a communication connection between the secure bastion host and the operation and maintenance end, and forwarding the viewing request to the secure bastion host.
[0010] In an optional embodiment of the present application, the local port of the bastion host is mapped to the encrypted communication port of the target server, including: obtaining a resolution query request to obtain the target server domain name; retrieving the target server domain name according to a pre-stored system hosts file to determine the mapping relationship between the target server and the bastion host; and mapping the local port of the bastion host to the encrypted communication port of the target server according to the mapping relationship.
[0011] In an optional embodiment of the present application, the bastion host and the server are both installed with a Linux system, and the local port of the bastion host is mapped to the encrypted communication port of the target server, including: mapping the local port of the bastion host to the encrypted communication port of the target server through the SSH tunnel capability of the Linux system, the local port is port 10000, and the encrypted communication port is port 80 or port 443.
[0012] The present application also provides a remote operation and maintenance method, which is applied to an operation and maintenance end, and a communication connection is established between the operation and maintenance end and the bastion host. The method includes the following steps: sending a viewing request to the bastion host to request to obtain the operation and maintenance data of the target server; obtaining the operation and maintenance data fed back by the bastion host after executing the remote operation and maintenance method applied to the bastion host as provided in the previous article; performing operation and maintenance operations according to the operation and maintenance data to monitor the operation status of the local area network where the target server is located.
[0013] In an optional embodiment of the present application, before sending a viewing request to the bastion host, the method also includes: obtaining program information within the local area network, the program information is used to indicate the client program deployed by the local terminal within the local area network; deploying the same client program in the operation and maintenance end according to the program information; and generating a viewing request based on manual operations and / or client programs.
[0014] In an optional embodiment of the present application, a viewing request is sent to a bastion host, including: building a domain name resolution environment in the operation and maintenance end; generating a domain name resolution request according to the viewing request, and having the domain name resolution environment execute the domain name resolution request according to the domain name resolution request to determine a target bastion host domain name, the target bastion host domain name points to the bastion host corresponding to the viewing request; and using the target bastion host domain name to send a viewing request to the bastion host.
[0015] In an optional embodiment of the present application, the operation and maintenance operation includes at least one of observing the device, using a network packet capture tool, and using a physical debugging tool to directly connect to the terminal device; performing operation and maintenance operations according to operation and maintenance data to monitor the operation of the local area network where the target server is located, including: performing operation and maintenance operations according to the operation and maintenance data to locate on-site faults, and generating and outputting an operation and maintenance report based on the on-site faults.
[0016] The present application also provides a computer-readable storage medium storing a computer program, which implements the aforementioned method when the computer program is executed by a processor.
[0017] The embodiments of the present application have the following beneficial effects:
[0018] This application can locate the target server to be viewed on the bastion host of the local area network according to the viewing request of the operation and maintenance end, and open up the communication tunnel between the bastion host and the target server through port mapping to proxy forwarding the operation and maintenance data to the operation and maintenance end, so as to realize the remote operation and maintenance operation of the operation and maintenance end. This makes it unnecessary for the operation and maintenance personnel to conduct on-site inspections in person, thus improving the operation and maintenance efficiency. At the same time, the bastion host only needs to use the mapped communication tunnel, which does not involve the bastion host to open sensitive ports, and does not require the root privileges of the bastion host, thus protecting the bastion host and realizing a safe, reliable and efficient operation and maintenance environment.
[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented according to the contents of the specification, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with the accompanying drawings. It should be understood that the above general description and the detailed description below are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] in:
[0022] Figure 1 A flowchart of a remote operation and maintenance method applied to a bastion host provided by an embodiment;
[0023] Figure 2 A schematic diagram of an application environment of a remote operation and maintenance method provided by an embodiment;
[0024] Figure 3 A flowchart of a remote operation and maintenance method applied to an operation and maintenance end provided by an embodiment;
[0025] Figure 4 A schematic block diagram of the structure of a computer device provided by an embodiment. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The existing operation and maintenance methods still require operation and maintenance personnel to go to the site to check, which is time-consuming and laborious. Even if it is possible to log in remotely to view the server and terminal logs, analyzing the errors in the logs to locate the fault is not intuitive, or it is difficult to fully simulate the on-site environment and data, resulting in difficulty in reproducing the fault, and the fault at the project site cannot be quickly eliminated. To overcome the above difficulties, this application proposes a remote operation and maintenance method. To clearly describe an operation and maintenance method provided by this embodiment, please refer to Figure 1~Figure 3 .
[0028] The remote operation and maintenance method provided in this application is applied to the bastion host and the operation and maintenance end respectively. The operations performed on different execution terminals will be described separately in the following. First of all, it should be made clear that the operating environment of the method provided in this application can be referred to for clear explanation. Figure 2 The application environment diagram is shown in Figure 1. Figure 2 As shown, the terminal bastion host 10 and the operation and maintenance terminal 30 executing the method of the present application are both located outside the local area network. However, the bastion host 10 is located at the edge of the local area network, connected to the server 20 in the local area network, and then connected to the operation and maintenance terminal 30. The local area network is constructed based on the server 20, and the server 20 establishes a communication connection with multiple local terminals 40 in the local area network. The local terminal 40 can specifically be a monitoring device, a personal computer, a set-top box or an intelligent all-in-one machine, etc., and the specific device type is not limited. The local terminal 40 can request the server 20 to obtain pages and data for presentation through the HTTP or HTTPS protocol.
[0029] A bastion host 10 is provided at the edge of the local area network, and the bastion host 10 establishes a communication connection with the server 20 through wired and / or wireless communication technology. Among them, the wireless communication technology may include but is not limited to: Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), wideband code division multiple access (W-CDMA), code division multiple access (CDMA), time division multiple access (TDMA), Bluetooth, Wireless Fidelity (WiFi) (such as IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE 802.11n), Voice over Internet protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed. For wireless communication connections established later or before, please refer to the description here, and no further description will be given later. The bastion host 10 is used as a transit point between the internal local area network and the external network, and can control external users or systems to access internal resources. The external user can be the operation and maintenance terminal 30.
[0030] The operation and maintenance end 30 is a terminal controlled by the operation and maintenance personnel. The main goal of the operation and maintenance personnel is to ensure the stability, security and efficiency of all terminals in the local area network system where the server 20 is located. In order to achieve remote management and control, the operation and maintenance end 30 can be a mobile terminal. Specifically, the specific form of the mobile terminal can be, for example, but not limited to, a mobile phone, a tablet computer, a smart TV, a personal digital assistant (English: personal digital assistant, abbreviated: PDA), a mobile Internet device (English: mobile Internet device, abbreviated: MID) and a wearable device (such as a smart watch). The mobile terminal can use an application (such as APP) to process and display the corresponding information and perform corresponding operations, thereby improving the use efficiency. It can also be a personal computer, automatic monitoring equipment, etc., and there is no specific restriction on this.
[0031] For security reasons, the local area network where the server 20 is located will not expose the service port to the public network, but will only provide an operation and maintenance login port, and will limit the login to one or several bastion hosts 10 through security measures such as IP whitelists and key restrictions. How the operation and maintenance end 30 remotely obtains the operation and maintenance data of the server 20 in the local area network must be processed by the bastion host 10. Therefore, the operation and maintenance method provided in this application must first be applied to the bastion host 10. To clearly describe the operation and maintenance method applied to the bastion host 10, please refer to Figure 1 , specifically including steps S110~S140.
[0032] Step S110: When a viewing request sent by the operation and maintenance end is obtained, the viewing request is parsed to determine the target server.
[0033] In one embodiment, step S110: when a viewing request sent by the operation and maintenance end 30 is obtained, the viewing request is parsed to determine the target server, including: receiving the viewing request through the HTTP service program; parsing the viewing request to obtain the target server domain name, and determining the target server according to the target server domain name.
[0034] In one embodiment, a communication connection is established between the bastion host 10 and the operation and maintenance end 30, and the bastion host 10 can receive the viewing request sent by the operation and maintenance end 30 through the HTTP service program. The HTTP service program can be Nginx, etc., and can be specifically set according to the configuration of the bastion host 10, without limitation. The viewing request is a request instruction generated by the operation and maintenance end 30 according to its operation and maintenance needs. The specific generation process will be explained during the execution of the operation and maintenance end 30, and will not be expanded here. It can be understood that the operation and maintenance needs of the operation and maintenance end 30 usually require the specification of viewing the relevant information of a specific local terminal 40 in the local area network, and it is necessary to establish a communication connection with the corresponding server 20, wherein the domain name of the target server is used to specify the server 20. For this, the bastion host 10 can parse the viewing request, and the target server domain name can be obtained through the analysis. The target server domain name can determine the target server to which the operation and maintenance end 30 is to point.
[0035] In one embodiment, step S110: parse the viewing request to determine the target server, including: determining whether the user has the login permission to the target server; when the user does not have the login permission to the target server, determining the security bastion host with the login permission; establishing a communication connection between the security bastion host and the operation and maintenance end 30, and forwarding the viewing request to the security bastion host.
[0036] In one embodiment, it is understandable that there may be only one server 20 in the local area network, or there may be multiple servers 20, and there may be more than one bastion host 10 connected to it outside the local area network. However, under normal circumstances, the server 20 only has the login permission for one bastion host 10, that is, only a specific bastion host 10 can interact with the corresponding server 20. The interaction between the operation and maintenance end 30 and the bastion host 10 may be uncertain, that is, there may be a situation where the bastion host 10 connected to the operation and maintenance end 30 does not have the login permission of the target server that the operation and maintenance end 30 wants to view. For this reason, after the bastion host 10 determines the target server through the viewing request, it is also necessary to determine whether it has the login permission of the target server that the viewing request needs to view. If it has, continue with the subsequent steps; if it does not have, the bastion host 10 needs to retrieve other bastion hosts 10 to determine the bastion host 10 with the target server login permission. For the bastion host 10 with the target server login permission, it is called a secure bastion host. At this time, the bastion host 10 can forward the communication connection or viewing request established with the operation and maintenance end 30 to the security bastion host, so that the security bastion host executes subsequent steps, so that the operation and maintenance end 30 can successfully obtain the required data.
[0037] Step S120: Map the local port of the bastion server to the encrypted communication port of the target server.
[0038] In one embodiment, step S120: mapping the local port of the bastion host 10 to the encrypted communication port of the target server, including: obtaining the target server domain name by resolving the request; retrieving the target server domain name according to a pre-stored system hosts file to determine the mapping relationship between the target server and the bastion host 10; mapping the local port of the bastion host 10 to the encrypted communication port of the target server according to the mapping relationship.
[0039] In one embodiment, the bastion host 10 stores a hosts file, and the hosts file records the mapping relationship between the server 20 and the bastion host 10. The bastion host 10 can obtain the target server domain name by parsing the query request, and can determine the mapping relationship between the target server and the bastion host 10 by searching the hosts file according to the target server domain name. The mapping relationship can be used to point the project service domain name to the bastion host 10 (for example, 127.0.0.1), and then the mapping relationship can be used to map the local port of the bastion host 10 to the encrypted communication port of the target server.
[0040] In one embodiment, the bastion host 10 and the server 20 are both installed with a Linux system. Step S120: Mapping the local port of the bastion host 10 to the encrypted communication port of the target server includes: mapping the local port of the bastion host 10 to the encrypted communication port of the target server through the SSH tunnel capability of the Linux system, the local port is port 10000, and the encrypted communication port is port 80 or port 443.
[0041] In one embodiment, the specific port mapping can be realized by installing the Linux ssh tunnel capability in the Linux system on both the bastion host 10 and the server 20. Through the ssh tunnel capability of the Linux system, the local port of the bastion host 10 (for example, port 10000) is mapped to the encrypted communication port of the target server (for example, port 80 or port 443). It can be understood that the HTTP service program on the bastion host 10 is configured by the administrator, and the operation and maintenance personnel only need to start the ssh tunnel when using the tunnel, which does not involve opening sensitive ports (80 or 443), and does not require the root permission of the bastion host 10, thereby protecting the bastion host 10. In addition, the HTTP service program on the bastion host 10 forwards requests by domain name instead of IP, ensuring that the Host request header in the HTTP and HTTPS requests remains unchanged, thereby being compatible with the situation where the project server 20 provides multiple domain name services.
[0042] Step S130: The viewing request is used to obtain operation and maintenance data from the target server through the mapped encrypted communication port, and the operation and maintenance data is fed back to the operation and maintenance end.
[0043] In one embodiment, after the tunnel is opened, the bastion host 10 can use the viewing request to obtain operation and maintenance data from the target server through the mapped encrypted communication port. The HTTP service of the bastion host 10 proxies the request of port 80 or 443 to the local ssh tunnel port (such as 10000). At this time, the viewing request of the operation and maintenance end 30 to the bastion host 10 is transferred to the ssh tunnel port by the HTTP service program of the bastion host 10, and then transferred to the service port of the target server (80 or 443) through the ssh tunnel, simulating the effect of the local terminal 40 in the local area network directly accessing the server 20 locally in the project. Then remote operation and maintenance is realized. The specific operation and maintenance process will be detailed in the operation and maintenance end 30 that performs the operation and maintenance, and will not be expanded here for the time being.
[0044] Furthermore, the operation and maintenance method provided in this application also needs to be applied to the bastion host 10. To clearly describe the operation and maintenance method applied to the operation and maintenance terminal 30, please refer to Figure 3 , specifically including steps S210~S230.
[0045] Step S210: Send a viewing request to the bastion host to request operation and maintenance data of the target server.
[0046] In one embodiment, in step S210: before sending a viewing request to the bastion host 10, the method also includes: obtaining program information within the local area network, the program information is used to indicate the client program deployed by the local terminal 40 within the local area network; according to the program information, deploying the same client program in the operation and maintenance end 30; generating a viewing request based on manual operation and / or the client program.
[0047] In one embodiment, in order to ensure that the operating environment of the local terminal 40 in the local area network can be fully simulated and restored, the operation and maintenance end 30 can obtain the program information in the local area network before sending the viewing request. The program information records all the client program information deployed by the local terminal 40 in the local area network. Then, the same client program as the local terminal 40 can be deployed on the operation and maintenance end 30 according to the program information. Thus, the operating environment is guaranteed to be consistent. During the operation of the client program running on the operation and maintenance end 30, if operation and maintenance intervention is required, the operation and maintenance personnel can generate a viewing request manually or by using the client program itself. Request to obtain the operation and maintenance data of the local terminal 40 in the local area network for remote operation and maintenance.
[0048] In one embodiment, step S210: sending a viewing request to the bastion host 10 includes: building a domain name resolution environment in the operation and maintenance end 30; generating a domain name resolution request according to the viewing request, and the domain name resolution environment executes the domain name resolution request according to the domain name resolution request to determine the target bastion host domain name, and the target bastion host domain name points to the bastion host 10 corresponding to the viewing request; using the target bastion host domain name to send a viewing request to the bastion host 10.
[0049] In one embodiment, a domain name resolution environment can be built in the operation and maintenance end 30, which can be specifically achieved by modifying the host or setting up a DNS server in the network. The purpose of building a domain name resolution environment is to be able to generate a domain name resolution request based on the viewing request, and then analyze and obtain the domain name of the target server that the viewing request wants to view, as well as the domain name of the target bastion host that needs to be communicated. The target bastion host is a bastion host 10 with management authority, that is, it points to the bastion host 10 corresponding to the viewing request. Therefore, the target bastion host domain name can be used to send a viewing request to the bastion host 10.
[0050] Step S140: When the operation and maintenance is completed, the mapping between the local port of the bastion host and the encrypted communication port of the target server is released.
[0051] In one embodiment, after the operation and maintenance data is sent to the operation and maintenance terminal 30, the opened mapping can be closed after the termination condition is met, thereby ensuring the data security of each device in the local area network. The termination condition may include but is not limited to: exceeding the preset time after the operation and maintenance data is sent; the operation and maintenance terminal 30 feedbacks the operation and maintenance termination information; the operation and maintenance terminal 30 disconnects from the bastion host 10, etc. Timely closing ensures the correct transmission of the required data and the data security in the local area network, thus realizing a safe operation and maintenance environment.
[0052] Step S220: Obtain the operation and maintenance data fed back by the bastion host after executing the remote operation and maintenance method applied to the bastion host as provided above.
[0053] In one embodiment, after sending a viewing request to the bastion host 10, the bastion host 10 can process the remote operation and maintenance method provided above and then feed back the operation and maintenance data. The remote operation and maintenance method executed by the bastion host 10 has been described in detail above. Please refer to the above for details and will not be repeated here.
[0054] Step S230: Execute operation and maintenance operations according to the operation and maintenance data to monitor the operation status of the local area network where the target server is located.
[0055] In one embodiment, the operation and maintenance operation includes at least one of observing the device, using a network packet capture tool, and using a physical debugging tool to directly connect to the terminal device. Step S230: Performing operation and maintenance operations according to the operation and maintenance data to monitor the operation of the local area network where the target server is located, including: performing operation and maintenance operations according to the operation and maintenance data to locate the on-site fault, generating and outputting an operation and maintenance report according to the on-site fault.
[0056] In one embodiment, the operation and maintenance operations may include, but are not limited to, at least one of observing equipment, using network packet capture tools, and using physical debugging tools to directly connect to terminal devices. After obtaining the operation and maintenance data, one or more of the operation and maintenance operations may be used to process the operation and maintenance data, so as to quickly and accurately locate on-site faults, and finally generate and output an operation and maintenance report. The operation and maintenance report may reflect the problems existing in the local terminal 40, the operating conditions, and the solutions. The specific generation is based on specific needs and is not limited to this. Intuitively locating on-site faults is more convenient and faster than remotely viewing logs to locate problems. Therefore, the operation and maintenance personnel can observe the operation of the on-site page in, for example, the office, without having to send people to the local terminal 40 for on-site inspections, thereby improving the efficiency of operation and maintenance.
[0057] Therefore, this application can locate the target server to be viewed on the bastion host of the local area network according to the viewing request of the operation and maintenance end, and open up the communication tunnel between the bastion host and the target server through port mapping to proxy forwarding the operation and maintenance data to the operation and maintenance end, so as to realize the remote operation and maintenance operation of the operation and maintenance end. This makes it unnecessary for the operation and maintenance personnel to conduct on-site inspections in person, thus improving the operation and maintenance efficiency. At the same time, the bastion host only needs to pass through the mapped communication tunnel, which does not involve the bastion host to open sensitive ports, and does not require the root permission of the bastion host, thus protecting the bastion host and realizing a safe, reliable and efficient operation and maintenance environment.
[0058] Figure 4 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be the bastion host 10 described above, or the operation and maintenance end 30. Figure 4 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a remote operation and maintenance method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement a remote operation and maintenance method. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0059] In one embodiment, the present application further proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the aforementioned method.
[0060] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0061] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0062] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A remote operation and maintenance method, applied to a bastion host, the bastion host is connected to a server in a local area network, the local area network includes the server and a local terminal, a communication connection is established between the server and the local terminal, and the bastion host also establishes a communication connection with an operation and maintenance end; It is characterized in that The method comprises the following steps: When obtaining a viewing request sent by the operation and maintenance end, parsing the viewing request to determine a target server; Mapping the local port of the bastion server to the encrypted communication port of the target server; Obtaining operation and maintenance data from the target server through the encrypted communication port, and feeding it back to the operation and maintenance end; When the operation and maintenance is completed, the mapping between the local port of the bastion host and the encrypted communication port of the target server is released; Mapping the local port of the bastion server to the encrypted communication port of the target server includes: Obtain and parse the query request to obtain the target server domain name; retrieve the target server domain name according to the pre-stored system hosts file to determine the mapping relationship between the target server and the bastion host; map the local port of the bastion host to the encrypted communication port of the target server according to the mapping relationship; and / or, When the bastion host and the server are both installed with the Linux system, the local port of the bastion host is mapped to the encrypted communication port of the target server through the SSH tunnel capability of the Linux system, the local port is port 10000, and the encrypted communication port is port 80 or port 443.
2. The remote operation and maintenance method according to claim 1, characterized in that: When the viewing request sent by the operation and maintenance end is obtained, parsing the viewing request to determine the target server includes: Receiving the viewing request through the HTTP service program; The query request is parsed to obtain a target server domain name, and the target server is determined according to the target server domain name.
3. The remote operation and maintenance method according to claim 1, characterized in that: The parsing the viewing request to determine the target server includes: Determine whether you have the login permission to the target server; When the login permission of the target server is not possessed, a security bastion host with the login permission is determined; a communication connection between the security bastion host and the operation and maintenance end is established, and the viewing request is forwarded to the security bastion host.
4. A remote operation and maintenance method, applied to an operation and maintenance end, wherein the operation and maintenance end has a communication connection with a bastion host, It is characterized in that The method comprises the following steps: Send a viewing request to the bastion host to request operation and maintenance data of the target server; Obtaining operation and maintenance data fed back by the bastion host after executing the method as described in any one of claims 1 to 3; An operation and maintenance operation is performed according to the operation and maintenance data to monitor the operation status of the local area network where the target server is located.
5. The remote operation and maintenance method according to claim 4, characterized in that: Before sending the viewing request to the bastion host, the method further includes: Acquire program information in the local area network, where the program information is used to indicate a client program deployed by a local terminal in the local area network; According to the program information, the same client program is deployed in the operation and maintenance end; and the viewing request is generated according to manual operation and / or the client program.
6. The remote operation and maintenance method according to claim 4, characterized in that: The sending a viewing request to the bastion host includes: Building a domain name resolution environment in the operation and maintenance end; Generate a domain name resolution request according to the viewing request, and the domain name resolution environment executes the domain name resolution request according to the domain name resolution request to determine a target bastion host domain name, wherein the target bastion host domain name points to the bastion host corresponding to the viewing request; The viewing request is sent to the bastion host using the target bastion host domain name.
7. The remote operation and maintenance method according to claim 4, characterized in that: The operation and maintenance operation includes at least one of observing the device, using a network packet capture tool, and using a physical debugging tool to directly connect to the terminal device; The performing operation and maintenance operations according to the operation and maintenance data to monitor the operation status of the local area network where the target server is located includes: The operation and maintenance operation is performed according to the operation and maintenance data to locate the on-site fault, and an operation and maintenance report is generated and outputted according to the on-site fault.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 or the method according to any one of claims 4 to 7 is implemented.
Citation Information
Patent Citations
Ukey mapping method of bastion host
CN111245792A
Operation and maintenance method, device and system of terminal equipment and storage medium
CN112838951A
Equipment remote debugging method, system and device and storage medium
CN113973128A
Automatic identification method and device for fortress machine bypassing behavior, equipment and medium
CN117061368A
Using a random host to tunnel to a remote application
US20050060534A1
