I have a cluster of centos servers and I want to regenerate the ssh host keys. There are a lot of them so I don't want to do:
ssh root@servername "ssh-keygen -q -f /etc/ssh/ssh_host_key -N '' -t rsa"
for each server because it would take a long time and I'd have to type y to over right and then add the new host key to my known hosts file. I have a list of IPs if that helps. I was thinking I could just do a for loop on them.
Any suggestions?