Beginner Package: openssh-client

scp

Copy files to or from a remote host over SSH.

Syntax

scp [options] source destination

Description

scp copies files securely between hosts using the same authentication as ssh, and remains popular for quick one-off transfers even though rsync is generally preferred for anything repeated or large.

Examples

scp file.txt alice@host:/home/alice/
Copy a local file to a remote host
scp alice@host:/var/log/app.log .
Copy a remote file to the current local directory
scp -r project/ alice@host:/srv/
Recursively copy a directory to a remote host

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux