Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0ccupi3R/3cae1604f403984ade74783ca1d4c91b to your computer and use it in GitHub Desktop.
Save 0ccupi3R/3cae1604f403984ade74783ca1d4c91b to your computer and use it in GitHub Desktop.
pass='YOURPASSWORD'
for host in `cat ips`
do
sshpass -p $pass ssh -o ConnectTimeout=1 -o StrictHostKeyChecking=no -o GSSAPIAuthentication=no root@$host "hostname"
done
### Using encoding to escape Shoulder Surfing ;)
vim tempfile
#In the file write your password
cat tempfile | openssl enc -base64
#This will give you the encoded string of your password
#Paste the copied string from above to the below variable
pas='BASE64OFYOURPASSWORD'
sshpass -p `echo $pas | openssl enc -base64 -d` ssh root@host "hostname"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment