SSH - Public key

When should one have to generate a public key on a Server when the public key is already created and used by other clients?

Thanks,
Rahul.

I assume you are asking the question:
"Why should one have to generate a public key on a Server when the public key is already created and used by other clients?"

The reason behind is that the set of public-private keys are unique for each host and in order that the "server" communicates to the "client" on ssh we need to generate this unique public key which when copied onto the "clients"
would able to authenticate the "server".

enc.

But my question was, if we already have a unique public-private key pair, would ne need to generate a new public key on the server?
Maybe, if the key pair has stopped working due to some reason?

Thanks,
Rahul.

The key pair should not 'stop working'. If a previously working key-based authentication has stopped working, it is probably the result of some file/directory permissions change rather than a corruption of the key-pair.

You could always try generating a new key-pair, but there is a good chance that it won't work either.

"Corruption" of the public-private key set can occour if somehow the key string gets modified. This may typically happen if you have copied it from a DOS based machine or if the key string is not in one single line continuation and is spread over multiple lines.
However, if you intend to generate the key pair on the server again you will need to copy the public key again onto the clients and remove the old public key (typically in .authorized_keys file).

HTH
enc.

Thanks.

Could there be some other possible reasons as well other than the public key string getting modified?

If the keys have not been messed with I'd look at the permissions of the keys and/or .ssh parent directory. Has there been any IP changes to client/servers? As stated earlier, you'd see some spoofing msgs regarding your authorized_keys file and would have to make changes there if you did.
Regenerating new keys all around isn't that hard. Of course, having a strange thing like this happen makes me "nervously curious" and I would want to know why this is behaving this way first.