> For the complete documentation index, see [llms.txt](https://strangebutohwell.gitbook.io/knowledge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://strangebutohwell.gitbook.io/knowledge/applications/ssh/scp.md).

# 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`
