scp

Securely copy files between hosts over SSH.

Synopsis

scp [options] source target

Core Options

-P PORT

Connect to a custom port.

-i file

Use a specific private key.

-r

Copy directories recursively.

-C

Enable compression.

-J host

ProxyJump via a bastion host.

Usage Examples

Copy to Server

Upload a file.

scp file.txt user@server:/opt/data/

Copy from Server

Download a file.

scp user@server:/opt/data/report.csv .

Copy Directory

Upload a folder recursively.

scp -r ./logs user@server:/var/tmp/

Custom Port & Key

Use a key and non-default port.

scp -i ~/.ssh/id_ed25519 -P 2222 file.txt user@server:/opt/data/
Built for builders.