Forum Discussion
Checking Image versions on multiple F5 Devices
Hello again,
Is there anyway I can just input password once and carry it to the end instead of entering password on every devices?
Regards
Hi ,
I had this explained in this step,
Have the passwordless login set up if not done already. You can refer internet on how to have passwordless login from a particular account. Or worst case, have a sshpass method used.
You can google on how to use sshpass method. Its your call to put explictly or by using in a file.
sshpass -p 'secret-password'
echo "HOSTNAME,Version" > /var/tmp/F5-version-report.csv
for i in `cat /var/tmp/serverlist.txt`;
do
sshpass -p 'secret-password' ssh root@$i "-o StrictHostKeyChecking=no" "bash -s" < ./version-script >> /var/tmp/F5-version-report.csv
done
or write your password in a file, make it readable by the user (share proper privileges)
sshpass -f secretfile
echo "HOSTNAME,Version" > /var/tmp/F5-version-report.csv
for i in `cat /var/tmp/serverlist.txt`;
do
sshpass -f secretfile root@$i "-o StrictHostKeyChecking=no" "bash -s" < ./version-script >> /var/tmp/F5-version-report.csv
done
Hope this helps.
Mark the answer as solution provided if you find it as your solution 🙂
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com