Last active
January 7, 2020 10:52
-
-
Save yuchdev/3d7fb1c52dd122b9c4209ee54706b313 to your computer and use it in GitHub Desktop.
Password autorization via SSH utility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install sshpass | |
# $1: 1st command-line param, password | |
# $2: 2nd command-line param, username | |
# $3: 3rd command-line param, rsync source path | |
# $4: 4th command-line param, rsync destination path | |
/usr/bin/rsync -ratlz --rsh="/usr/bin/sshpass -p $1 ssh -o StrictHostKeyChecking=no -l $2" $3 $4 | |
# Alternatively, you can avoid the password prompt on rsync command | |
# by setting the environment variable RSYNC_PASSWORD to the password | |
# or using the --password-file option |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment