You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Uploading or downloading files
Transferring files from local Linux or macOS system to Linux instance (via SCP)
Copy page
Download PDF
Transferring files from local Linux or macOS system to Linux instance (via SCP)
If your local computer is running the Linux or macOS operating system, you can use SCP to transfer files to a Linux ECS instance.​
Prerequisites​
The Linux ECS instance must meet the following requirements:​
  • The instance is in the Running status.​
  • An inbound rule is added to the security group of the instance to allow inbound traffic on port 22. For detailed steps, refer to Changing security group rules.​
Software version​
  • Operating system of the local computer: CentOS 7.6.​
  • Operating system of the ECS instance: CentOS 7.6.​
Procedure​
Upload a file​
  1. Obtain the EIP of the Linux ECS instance.​
  1. Execute the following command on your local computer to upload a file to the Linux ECS instance.​
  • ​
    scp Local file path Username of the ECS instance@EIP of the ECS instance:Path of the uploaded file on the ECS instance​
    ​
  • For example, you can execute the following command to upload the local file /home/test.txt to the corresponding directory on the ECS instance whose EIP is 10.x.x.x:​
  • ​
    scp /home/test.txt root@10.x.x.x:/home/​
    ​
  1. Enter the login password as prompted, and then complete the file upload. If you forget your password, reset the password by referring to Resetting login password.​
  • ​image​​
Download a file​
  1. Execute the following command on the local computer to download a file from the ECS instance to the local computer.​
  • ​
    scp Username of the ECS instance@EIP of the ECS instance:Path to the file on the ECS instance Path to the downloaded file on the local computer​
    ​
  • For example, you can execute the following command to download the file /home/test.txt from the ECS instance whose EIP is 10.x.x.x to the local /home/ directory:​
  • ​
    scp root@10.x.x.x:/home/test.txt /home/​
    ​
  1. Enter the login password as prompted, and then download the file.​
  • ​image​​
Last updated: 2026.06.24 17:17:26