# Upload data using SCP command

SCP (secure copy) is a command-line utility that allows you to securely copy files and directories between two locations. With scp , you can copy a file or directory: From your local system to a remote system.

It uses the same authentication and security as it is used in the Secure Shell (SSH) protocol. SCP is known for its simplicity, security and pre-installed availability.

When you launch an instance on Q Blocks, you can access it either through Jupyter Lab or through Terminal SSH.

SSH access to your Q Blocks instances is controlled via:

1. Password, and
2. Secure public private key pair

While accessing your instance, you can download your private SSH key or use password for authentication. For the sake of this SCP example, we will use SSH Key based authentication.

To get started, please follow the steps mentioned below:

1. Go to the instances page in your Q Blocks Dashboard.
2. Click on "Select an action" button on your instance and then choose the "Connect" option
3. Copy the <mark style="color:red;">SSH port</mark> of your instance as shown in the image below:

<figure><img src="/files/46unnRufcDFxG1A9QLbG" alt="" width="563"><figcaption></figcaption></figure>

4. Copy the <mark style="color:red;">Hostname</mark> of your instance:
   * In the above image, you can see our example hostname is: <mark style="color:blue;">jeu.qblocks.cloud</mark>.
   * It will be different in your case but you need to copy your hostname for running scp command.
5. Go to your terminal and execute the following scp command:

```bash
scp -i /PATH/TO/SSH/KEY -P SSH_PORT /PATH/TO/LOCAL_FILE qblocks@HOSTNAME:/home/qblocks/
```

6. In the above command we specify the following:

   * <mark style="color:red;">`/PATH/TO/SSH/KEY`</mark> for using it as authentication.
   * <mark style="color:red;">`SSH_PORT`</mark> is our instance's SSH Port.
   * <mark style="color:red;">`/PATH/TO/LOCAL_FILE`</mark> is the source path of the file that will be uploaded using SCP. You may even specify a folder path for upload.
   * <mark style="color:red;">`qblocks`</mark> is the default user of your instance. You can create new users as well in your instance and use its password or ssh key for scp.
   * <mark style="color:red;">`HOSTNAME`</mark> is your instance's hostname.
   * <mark style="color:red;">`/home/qblocks/`</mark> is the destination path where you want the data to be uploaded in your instance. You may specify any particular existing path in your instance as a destination path.

   This should help you quickly upload any file or data to your Q Blocks instance using scp.

   If you still face issues then don't hesitate to reach out to us at: [support@qblocks.cloud](mailto:support@qblocks.cloud?subject=Unable%20to%20launch%20TensorBoard).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qblocks.cloud/q-blocks-how-to-guide/upload-data-using-scp-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
