Create script for change root password via SSH

HI I 'm new shall script and unix. I want to create script for change password root by ssh-keygen command . I have 50 servers and I want ot login ot the servers via ssh by type ones password and can login every machines.The script ssh-keygen must ot generate key every weekly than it send new password ot admin by email or SMS. Please help me Thank you Pellnapook

Not a very good idea, each server should have it's own password. If you are sending root passwords via email or SMS you are going to have heaps of trouble at your next security audit.

Thank you very much and I think so.