Technology Encyclopedia Home >How to upload files to a Linux instance?

How to upload files to a Linux instance?

To upload files to a Linux instance, you can use several methods depending on your environment and preferences. Here are common approaches:

  1. SCP (Secure Copy Protocol) – A simple way to transfer files securely over SSH.
    Example:

    scp /path/to/local/file username@instance_ip:/path/to/remote/directory  
    

    Replace username with your Linux user (e.g., ubuntu or root), instance_ip with the instance's public IP, and adjust the paths accordingly.

  2. SFTP (SSH File Transfer Protocol) – Provides an interactive file transfer session over SSH.
    Example:

    sftp username@instance_ip  
    put /path/to/local/file /path/to/remote/directory  
    
  3. RSync – Efficient for syncing large files or directories, with incremental transfers.
    Example:

    rsync -avz /path/to/local/file username@instance_ip:/path/to/remote/directory  
    
  4. Cloud Storage Integration (e.g., Tencent Cloud COS) – If your instance is on Tencent Cloud, you can upload files to Tencent Cloud Object Storage (COS) and then download them to the instance using coscli or SDKs.
    Example (using coscli):

    coscli cp /path/to/local/file cos://bucket-name/path/to/remote/file  
    
  5. HTTP/FTP – If the instance runs a web or FTP server, you can upload files via a browser or FTP client.

For Tencent Cloud users, COS is a scalable and secure option for storing and managing files, with integration support for Linux instances.