# scp

> A command that copies a file to or from a server. It goes over SSH.

**Field:** Infrastructure  
**Category:** SSH & Remote Access  
**Also known as:** scp Command, Secure Copy, Secure Copy Protocol

## Think of it like

Think of it like posting one parcel through a locked chute. It lands on the far side, and that is it.

## Definition

scp copies files between two computers over SSH. You name the file, then where it should go, with a colon after the server's address. It uses the same login and keys as ssh. It copies the whole file every time. Since OpenSSH 9.0 it moves the data with the SFTP protocol underneath.

## Example

Emma needs one report on her server. She types one scp line, and the file is there a second later.

## Example code

```bash
scp report.pdf emma@203.0.113.10:/home/emma/
```

Copy one file from the laptop to Emma's home on the server.

## Why it matters

It is the quickest way to move one file when you already have SSH access.

## Common mistake

Leaving out the colon after the address. Then scp makes a file on your own computer instead.

## Three principles

- **Over SSH.** Same login, same keys.
- **Whole file.** Copies all of it each time.
- **Mind the colon.** It marks the far side.

## Related terms

- [SSH File Transfer Protocol (SFTP)](https://learn.benibix.com/term/infrastructure/sftp)
- [rsync](https://learn.benibix.com/term/infrastructure/rsync)
- [Secure Shell (SSH)](https://learn.benibix.com/term/infrastructure/ssh)
- [File Path](https://learn.benibix.com/term/development/file-path)

## Told apart from

- [scp vs rsync](https://learn.benibix.com/compare/scp-vs-rsync): People often think rsync is just a faster scp, since both copy files to a server. Both go over SSH, but scp sends the whole file every time. rsync checks what is already there first, and sends only what changed. For one file once, scp is fine. For a big folder you copy again and again, rsync wins.

## Taught in

- [scp, SFTP and rsync](https://learn.benibix.com/learn/infrastructure-ssh/scp-sftp-and-rsync): SSH, 7/9

![Three lanes, each running from a laptop to a server through the same SSH tunnel. In the scp lane, one file is copied once. In the sftp lane, a session lists folders and uploads a file, like a file manager. In the rsync lane, a folder of ten files is checked and only the two changed files are sent.](https://learn.benibix.com/diagrams/inf3-file-transfer.svg)

---

Source: https://learn.benibix.com/term/infrastructure/scp
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
