You can send remote commands in the Elastic Compute Service (ECS) console to quickly perform routine O&M operations, such as batch installing or uninstalling software on ECS instances, resetting user passwords, and automating O&M scripts, on instances. This topic describes how to send commands to one or more ECS instances in the ECS console.
Prerequisites
The instances to which you want to send commands are in the Running state.
Cloud Assistant Agent is running on the instances. For information about the operations that can be performed by using Cloud Assistant Agent, see Start, stop, or uninstall the Cloud Assistant Agent.
Procedure
Cloud Assistant Agent is required when you send remote commands, and the remote commands count against the quota of Cloud Assistant commands. For information about the usage notes and limits of Cloud Assistant Agent, see Overview.
You can also send and run commands on the Cloud Assistant page. For more information, see Use the immediate execution feature.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Use one of the following methods to send remote commands:
To send a remote command to a single ECS instance, choose > Connect > Send Remote Commands in the Actions column of the instance.
To send a remote command to multiple ECS instances, select multiple instances and choose
in the lower part of the page.
In the dialog box that appears, complete the command settings and click Run.
NoteIf you select some Linux instances and some Windows instances to send commands to, configure the command settings based on the operating systems of the instances.
Parameter
Description
Example
Command Type
For Linux instances, Shell is selected by default. You can also select Python or Perl.
For Windows instances, select Bat or PowerShell.
Shell
Timeout
The timeout period for the one-time execution of the command. After the timeout period ends, the sending process is forcefully terminated.
Valid values: 10 to 86400.
Unit: seconds. 86,400 seconds is equivalent to 24 hours.
60
Command
A command output must be returned in the one-time execution of the command. You cannot interact with the command output.
For information about a simple shell command, see View the system configurations of ECS instances.
NoteAfter a command is run, you can enter another command in the Command Content code editor to run on the selected instances.
None
References
You can batch run Cloud Assistant commands or upload files on ECS instances to which specific tags are added to maintain the instances. For more information, see Control the executions of Cloud Assistant commands based on tags.
You can use Cloud Assistant to maintain ECS instances in a password-free and logon-free manner without the need to use jump servers. For more information, see Overview.