Submitting Commands to ECSs Without Login
Scenarios
ECS supports the function of submitting commands without login. You can submit script commands to one or more ECSs without login to quickly perform routine maintenance on them, such as installing or uninstalling software, resetting passwords, or executing automated O&M scripts.
This section describes how to submit commands to one or more ECSs through the management console without logging in to them.
Constraints
- Cloud Operations Center (COC) needs to be enabled and authorized.
For IAM users, permissions for COC operations need to be granted. For details, see Configuring Custom Policies for ECS Self-Service O&M.
- A UniAgent must be installed. A UniAgent is a unified data collection agent that supports script delivery and execution.
If the UniAgent is not installed on the ECS, commands cannot be submitted without login. For details, see Installing UniAgent on an ECS.
- This function only applies to ECSs whose status is Running.
Procedure
To submit script commands to one or more ECSs, do as follows.
- Log in to the ECS console and access the ECS list page.
- Locate the target ECS and choose More > Submit Commands in the Operation column.
- (Optional) On the Enable COC and Grant Permissions page, read and agree to the service statement, and click Enable and Authorize.
This page is displayed if COC is not enabled and authorized.
- In the slide-out panel, configure required parameters.
A UniAgent is required for submitting commands. If a message is displayed indicating that the UniAgent is not installed or failed to be installed, install it first by referring to Installing UniAgent on an ECS.
Figure 1 Submitting commandsTable 1 Parameters for submitting commands Parameter
Description
Target Instance
Select the target instance that the commands will be sent to. An instance is selected by default.
Operating System
Operating system of the target instance. Currently, Linux and Windows are supported.
Select the operating system of the target instance.
Execution User
User who executes the commands.
- Windows ECS: The execution user is system by default. It cannot be changed.
- Linux ECS: The execution user is root by default. You can change it as needed.
Execution Plan
Execution plan of the commands. The default setting is Execute Now.
Timeout Interval
Timeout interval for an individual command execution. If the command execution times out, the command submission will be stopped forcibly.
Value range: 6–1,800 seconds (24 hours)
Unit: second
Command Type
Type of the script commands that can be submitted.
- Windows ECS: The bat type is supported.
- Linux ECS: The shell (default setting) and Python types are supported.
Command Input
Input box of the commands to be submitted.
The input content must be a command that can return results after a single execution. Interaction with the command output is not supported.
NOTE:After a command is executed, you can enter another command in the command input box and run the command.
Command Output
Output box of the commands. You can view the command execution results here.
- Log in to the ECS console and access the ECS list page.
- In the ECS list, select the target ECSs that commands will be sent to.
- Above the ECS list, choose More > Submit Commands.
- (Optional) On the Enable COC and Grant Permissions page, read and agree to the service statement, and click Enable and Authorize.
This page is displayed if COC is not enabled and authorized.
- In the slide-out panel, configure required parameters.
A UniAgent is required for submitting commands. If a message is displayed indicating that the UniAgent is not installed or failed to be installed, install it first by referring to Installing UniAgent on an ECS.
If the selected ECSs run different OSs (Linux and Windows), you need to submit commands to the ECSs separately.
Figure 2 Batch submitting commandsTable 2 Parameters for batch submitting commands Parameter
Description
Target Instance
Select the target instances that the commands will be sent to. Instances selected in step 2 are displayed here by default.
Operating System
Operating system of the target instance. Currently, Linux and Windows are supported.
Select the operating system of the target instances. If the target instances include both Linux and Windows ECSs, you need to submit commands to them separately.
Execution User
User who executes the commands.
- Windows ECS: The execution user is system by default. It cannot be changed.
- Linux ECS: The execution user is root by default. You can change it as needed.
Execution Plan
Execution plan of the commands. The default setting is Execute Now.
Timeout Interval
Timeout interval for an individual command execution. If the command execution times out, the command submission will be stopped forcibly.
Value range: 6–1,800 seconds (24 hours)
Unit: second
Command Type
Type of the script commands that can be submitted.
- Windows ECS: The bat type is supported.
- Linux ECS: The shell (default setting) and Python types are supported.
Command Input
Input box of the commands to be submitted.
The input content must be a command that can return results after a single execution. Interaction with the command output is not supported.
NOTE:After a command is executed, you can enter another command in the command input box and run the command.
Command Output
Output box of the commands. You can view the command execution results here.
When submitting commands to multiple ECSs in a batch, you can view the execution results on different tabs in the command output box.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot