Skip to content

Instantly share code, notes, and snippets.

@fanurs
Last active June 22, 2023 11:51
Show Gist options
  • Save fanurs/b6b2ba9bbccfd3f949d68bc82cbe2d9a to your computer and use it in GitHub Desktop.
Save fanurs/b6b2ba9bbccfd3f949d68bc82cbe2d9a to your computer and use it in GitHub Desktop.
Transferring files using scp
#!/bin/bash
#############################
# from "here" to "there"
#############################
scp source_files user@destination:/path/at/the/destination
# with jumphost
scp -o 'ProxyCommand ssh user@jumphost -W %h:%p' source_files user@destination:/path/at/the/destination
#############################
# from "there" to "here"
#############################
scp user@source:/path/at/the/source/files destination
# with jumphost
scp -o 'ProxyCommand ssh user@jumphost -W %h:%p' user@source:/path/at/the/source/files destination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment