Using Secure Copy

Published

Updated

🔐

Copy files over SSH.

SCP (Secure Copy Protocol) enables secure file transfers between your local machine and remote servers using SSH encryption.

About scp

scp copies files between the local machine and the environment over SSH, with the same SSH key. Linux and macOS ship with it, Windows has it in WSL and in the built-in OpenSSH client.

For folders and repeated uploads, use rsync: it transfers only the changes.

Examples

Paths on the environment are relative to its home folder, the project root.

# Upload a file to the project root
scp local-file.php {{app-env-id}}@ssh.{{region}}.frbit.app:

# Upload several files
scp file1.php file2.css {{app-env-id}}@ssh.{{region}}.frbit.app:

# Download a file to the current folder
scp {{app-env-id}}@ssh.{{region}}.frbit.app:composer.lock ./

# Download a folder
scp -r {{app-env-id}}@ssh.{{region}}.frbit.app:web/uploads ./
bash
OptionEffect
-rCopies folders recursively
-pKeeps modification times and permissions
-vVerbose output for debugging the connection

scp, SFTP or rsync

ToolUse it for
scpSingle files, one command
SFTPBrowsing and copying in a GUI client
rsyncFolders, repeated syncs, only the changes

Written by humans and AI in collaboration.

AI use & editorial processEdit on GitHub ↗