Skip to content

Instantly share code, notes, and snippets.

@FranklyFuzzy
Created April 7, 2022 14:19
Show Gist options
  • Save FranklyFuzzy/47c5bfa56af18773899b2cbc9bab4c5c to your computer and use it in GitHub Desktop.
Save FranklyFuzzy/47c5bfa56af18773899b2cbc9bab4c5c to your computer and use it in GitHub Desktop.
MultiSSH Grab files from multiple remote boxes that use the same creds. Requires sshpass.
echo 'what username will we use today?'
read varuser
echo 'what password will we use today?'
read varpw
for s in `cat servers.txt` ; do
echo; echo $s Starting
sshpass -p ''$varpw'' scp -r $varuser@$s:/etc/yum /home/user/Desktop/output/$s-yum
sshpass -p ''$varpw'' scp -r $varuser@$s:/etc/yum.repos.d /home/user/Desktop/output/$s-yum.repos
echo $s 'Done'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment