Thursday, January 19, 2012

Bypass SSH Host Key Check

Scenario:

You want to loop through a list of hosts that you may never logged in before, and having to type 'yes' for each entry can be a real pain.

for i in `cat SOME_LIST_OF_HOSTS.txt`
do
    print "$i\n"
    ssh -o 'StrictHostKeyChecking=no' $i df -Ph | awk '{print $1 " " $2}'
done 

0 comments: