All Products
Search
Document Center

Elastic Compute Service:send remote commands

Last Updated:Mar 26, 2024

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.

Note

You can also send and run commands on the Cloud Assistant page. For more information, see Use the immediate execution feature.

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instances.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. Use one of the following methods to send remote commands:

    • To send a remote command to a single ECS instance, choose icon1 > 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 More > Connect > Send Command in the lower part of the page.

  5. In the dialog box that appears, complete the command settings and click Run.

    Note

    If 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.

    Note

    After 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.