Thursday, October 22, 2015

Installing authorized_keys over a range of hosts automatically

$ for i in `seq 60 75`; do ssh -o "StrictHostKeyChecking no" username@mrh009$i.host.com '[ ! -e .ssh ] &&  mkdir .ssh; echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEArnIJhZCiJz8arKHd1C5gi2B7G22VuMeqDGcj8jv+sdfsdfsdfsdfsdfsdfsfdsfNBekqviSUFXiG1cBNpNxaAstOWyWmKaS1oefeNJ5waihlzR5V9QTTdBCrYavHj4viPMLWfm70eOhZhOzXQjl4x/xSrh/sadfasdfasdf= " > .ssh/authorized_keys && chmod 700 .ssh '; done;

No comments:

Post a Comment