Created
April 7, 2022 14:19
-
-
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.
This file contains 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
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