Skip to content

Instantly share code, notes, and snippets.

@peterdalle
Created March 24, 2016 14:29
Show Gist options
  • Save peterdalle/466597a449a6a87648be to your computer and use it in GitHub Desktop.
Save peterdalle/466597a449a6a87648be to your computer and use it in GitHub Desktop.
Automatically download files via SSH without password
#!/usr/bin/bash
# Download CSV files from Linux server (iny my case, Raspberry Pi and Ubuntu)
# over SSH without the need to supply password. Note that Cygwin have to be
# used with this file since Git Bash uses other keyfiles.
#
# 1.Upload keyfiles:
# scp /home/username/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys2
# 2. Don't forget to make file executable:
# chmod +x download.sh
echo "Downloading from Raspberry Pi..."
scp [email protected]:/home/pi/*.csv /local-dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment