- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
Instance data
Uploading or downloading files
Transferring files from local Linux or macOS system to Linux instance (via SCP)
Uploading or downloading files
Transferring files from local Linux or macOS system to Linux instance (via SCP)
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
- Obtain the EIP of the Linux ECS instance.
- Execute the following command on your local computer to upload a file to the Linux 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:
- 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.
-
Download a file
- Execute the following command on the local computer to download a file from the ECS instance to 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:
- Enter the login password as prompted, and then download the file.
-
Last updated: 2026.06.24 17:17:26