Skip to content

Instantly share code, notes, and snippets.

@versvs
Created January 27, 2019 10:42
Show Gist options
  • Select an option

  • Save versvs/47539f4270595c9b2fb5405d7272f135 to your computer and use it in GitHub Desktop.

Select an option

Save versvs/47539f4270595c9b2fb5405d7272f135 to your computer and use it in GitHub Desktop.
# -r, copy recursively
# -p, maintain permissions of the files
# -i, without specifying the private key, the ssh auth will not work
# -o ignore on screen logs that would disrupt the scp protocol
# to copy from remote to local, just change the order of the two last parameters
scp -i .ssh/login-key.key -o "StrictHostKeyChecking no" -rp /source/folder username@remote_hostname_or_ip:/destination/folder/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment