Skip to content

Instantly share code, notes, and snippets.

@LiamKarlMitchell
Created June 14, 2017 00:36
Show Gist options
  • Save LiamKarlMitchell/81e918a9dd7a26b74650adf37dd72544 to your computer and use it in GitHub Desktop.
Save LiamKarlMitchell/81e918a9dd7a26b74650adf37dd72544 to your computer and use it in GitHub Desktop.
Automated connect to sftp and download all files.
#!/bin/sh
USER=$1
PASSWD=$2
HOST=$3
# Connect to FTP and download all files.
SSHPASS=$PASSWD sshpass -e sftp -oBatchMode=no -b - $USER@$HOST <<EOF
get -r *
quit
EOF
@LiamKarlMitchell
Copy link
Author

LiamKarlMitchell commented Jun 14, 2017

Depends on sshpass

sudo apt-get install sshpass

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