for line in $(cat hosts) do ssh-keygen -f "/root/.ssh/known_hosts" -R $line ssh-keyscan $line >> /root/.ssh/known_hosts done