# SCP

## Summary

`scp` copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1). scp will ask for passwords or passphrases if they are needed for authentication.

## Basic usage

The basic usage of `scp` is as follows:

```
scp file host:path
```

This copies the **file** to the remote **host**. The destination `path` is optional, but can be a directory on the server, or even a file name if copying a single file. It is possible to specify multiple files; the last one is the destination.

To copy a file from the remote host, use:

```
scp host:file path
```

This fetches the file from the **host**, and puts it in the directory indicated by **`path`**. Often, `path` is just `.`, meaning the current working directory.

## Source & Target

`scp [source] [target]`

The source and target may be specified as a local pathname, a remote host with optional path in the form `[user@]host:[path]`, or a URI in the form `scp://[user@]host[:port][/path]`.&#x20;

Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing \`:' as host specifiers.

When copying between two remote hosts, if the URI format is used, a port may only be specified on the target if the -3 option is used.

## Syntax

`scp [source] [target]`

`scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file] [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program] source ... target`


---

# 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://strangebutohwell.gitbook.io/knowledge/applications/ssh/scp.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.
