All Products
Search
Document Center

Elastic Compute Service:Use WinSCP to upload or download a file

Last Updated:Mar 06, 2024

If your on-premises machine runs Windows, you can use WinSCP to connect to a Linux Elastic Compute Service (ECS) instance and upload or download files.

What is WinSCP?

WinSCP can be used to copy files between on-premises and remote computers in a secure manner. Compared with FTP, WinSCP allows you to use a username and password to access a server without additional configurations on the server.

Scenarios

  • On-premises machine: Windows

  • ECS instance: Linux

  • File size: unlimited

Important

Prerequisite

  • The ECS instance is in the Running state.

  • The external public IP address of the ECS instance is obtained.

    Note

    If your ECS instance cannot communicate with the Internet, you can associate the instance with an elastic IP address (EIP). For more information, see Associate or disassociate an EIP.

  • Port 22 is open in the inbound rule of the security group to which the instance belongs. For more information, see Add security group rules.

Procedure

Use WinSCP to connect to an ECS instance

  1. Download and install the WinSCP client on your on-premises Windows machine.

    For more information about how to download and install WinSCP, visit the official WinSCP website.

  2. Start WinSCP. The Login dialog box appears.

  3. In the Session section, configure the parameters, as shown in the following figure.

    用户密码登录Parameter description:

    • File protocol: Select SFTP or SCP.

    • Host name: Enter the public IP address of the Linux ECS instance.

    • Port number: The default port number is 22.

    • User name: Enter a username for the Linux ECS instance. The default username is root.

    • Password: Enter the password that you specified for the username when you created the Linux ECS instance, or enter the password that is converted from the key pair that is bound to the Linux ECS instance.

      You can also perform the following operations to log on to a Linux ECS instance by using a key pair.

      1. In the Session section, click Advanced.

      2. In the Advanced Site Settings dialog box, choose SSH > Authentication in the left-side navigation pane. In the Private key file field, upload the key file of the Linux ECS instance and click OK.

        image.png

      Note

      If you forget the password of the ECS instance, you can reset the password. For more information, see Reset the logon password of an instance.

  4. Click Login.

    Go to the file transfer page of the WinSCP window.

Upload or download a file

  • Upload a file to the ECS instance: Select a file on your on-premises machine on the left and drag the file to the ECS instance on the right to upload the file to the ECS instance.

  • Download a file to your on-premises machine: Select a file on the ECS instance on the right and drag the file to your on-premises machine on the left to download the file to your on-premises machine.

References