SCP and SFTP Cheat Sheet/Use a jump host with scp

Transfer via a bastion host.

Section: scp Basics

Use a jump host with scp

bash
bash
scp -J bastion.example.com ./db.dump user@private.internal:/tmp/
Explanation

Transfer via a bastion host.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing scp Basics
Upload a file
Copy a local file to a remote host.
OpenIn sheetbashsame section
Download a file
Copy a remote file to the current directory.
OpenIn sheetbashsame section
Upload a directory recursively
Copy a full directory tree to a remote host.
OpenIn sheetbashsame section
Use scp on a custom port
Specify an alternate SSH port for scp.
OpenIn sheetbashsame section
Use a specific key with scp
Specify a private key file for transfers.
OpenIn sheetbashsame section
Preserve times and mode bits
Keep file times and modes during copy.
OpenIn sheetbashsame section