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 ./
| Option | Effect |
|---|---|
-r | Copies folders recursively |
-p | Keeps modification times and permissions |
-v | Verbose output for debugging the connection |