Skip to content

Instantly share code, notes, and snippets.

@NaserKhoshfetrat
Created February 19, 2022 14:16
Show Gist options
  • Save NaserKhoshfetrat/6a0ed744b714967bbdf16e1aa7350fa7 to your computer and use it in GitHub Desktop.
Save NaserKhoshfetrat/6a0ed744b714967bbdf16e1aa7350fa7 to your computer and use it in GitHub Desktop.
download file from linux to linux over ssh
scp [email protected]:~/todo.txt ~/downloads
@NaserKhoshfetrat
Copy link
Author

scp [email protected]:foobar.txt /local/dir

@NaserKhoshfetrat
Copy link
Author

If you want to access EC2 (or other service that requires authenticating with a private key), use the -i option:

scp -i key_file.pem [email protected]:/remote/dir/foobar.txt /local/dir

@NaserKhoshfetrat
Copy link
Author

NaserKhoshfetrat commented Feb 19, 2022

copy something from another system to this system:

scp username@hostname:/path/to/remote/file /path/to/local/file

Copy something from this system to some other system:

scp /path/to/local/file username@hostname:/path/to/remote/file

Copy something from some system to some other system:

scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment