All Products
Search
Document Center

Elastic Compute Service:Connect to a Linux instance from a mobile device

Last Updated:Dec 05, 2023

This topic describes how to use a username and a password to connect to a Linux Elastic Compute Service (ECS) instance from an iOS or Android mobile device.

Prerequisites

  • The instance to which you want to connect is in the Running state. If the instance is not in the Running state, start the instance. For more information, see Start an instance.

  • A logon password is set for the instance. If you have not set a password or if you have forgotten the password, you must reset the password for the instance. For more information, see Reset the logon password of an instance.

  • The instance has Internet connectivity.

    • To provide Internet connectivity to an instance that resides in a virtual private cloud (VPC), you can assign a public IP address and purchase public bandwidth during the creation of the instance, or associate an elastic IP address (EIP) with the instance after the instance is created. For more information, see Create an IPv4 VPC.

    • To provide Internet connectivity to an instance that resides in the classic network, you can assign a public IP address and purchase public bandwidth during the creation of the instance, or modify the public bandwidth configurations after the instance is created. For more information, see Modify the bandwidth configurations of subscription instances or Modify the bandwidth configurations of pay-as-you-go instances.

  • Rules are added to the security group to which the instance belongs to allow access to the corresponding ports. For more information, see Add a security group rule.

    Network type

    Rule direction

    Action

    Port range

    Priority

    Authorization object

    VPC

    Inbound

    Allow

    SSH(22)

    1

    The public IP address of your on-premises client, not the public IP address of the instance.

    Important

    You can also specify 0.0.0.0/0 as the authorization object to allow inbound access from all IP addresses. However, this imposes security risks. Proceed with caution.

    Classic network

    Internet ingress

Background information

You can use one of the following methods to connect to a Linux instance based on the operating system of your mobile device:

Use iTerminal on an iOS device to connect to a Linux instance

In this example, a username and a password are used for authentication.

  1. Download iTerminal.

  2. Start iTerminal.

  3. In the upper part of the page, tap SSH.SSH

  4. Configure the following parameters and tap Connect:

    • Nickname: Enter a name for the session. In this example, DocTest is entered.

    • Host Name or IP Address: Enter the auto-assigned public IP address or elastic IP address (EIP) of the Linux instance to which you want to connect.

    • Port: Enter the port number 22.

    • User Name: Enter the username that you specified when you created the Linux instance. Example: root or ecs-user.

    • Password: Enter the logon password for the Linux instance.

    英文图1.png

    The page shown in the following figure indicates that you are connected to the Linux instance.iOS环境中连接Linux实例-014

Use JuiceSSH on an Android device to connect to a Linux instance

In this example, a username and a password are used for authentication.

  1. Install JuiceSSH.

  2. Start JuiceSSH.

  3. Tap Manage Connections.

    juicessh管理连接.jpg

  4. Tap the + icon.

  5. Configure the following parameters and tap the icon:

    • Nickname: Enter a name for the session. In this example, DocTest is entered.

    • Type: Use the default value SSH.

    • Address: Enter the auto-assigned public IP address or EIP of the Linux instance to which you want to connect.

    • Perform the following steps to configure the Identity parameter:

      1. Tap Identity and select New from the drop-down list.

      2. Configure the following parameters and tap the icon:

        • Nickname: optional. You can enter an identity name to facilitate subsequent management. In this example, DocTest is entered.

        • Username: Enter the username that you specified when you created the Linux instance. Example: root or ecs-user.

        • Password: Tap UPDATE/CLEAR and enter the logon password for the Linux instance.

    • Port: Enter the port number 22.

  6. Confirm the prompt and tap ACCEPT.

  7. (Optional) The first time you connect to the Linux instance, you are prompted to enter information such as the font size. Confirm the information and tap OK - I’VE GOT IT!.

The page shown in the following figure indicates that you are connected to the Linux instance.