It is not clear to me why the SSH key authentication needs the public key saved on server. Usually the steps involved are:
- Generate a key pair on client
- The public key is saved on server and the private key is used by client to perform authentication
I've never seen a solution like:
- Generate a key pair on server
- Public key saved on client
I think the last solution is possible but never used due to impossibility to guarantee access to a restricted number of user: the public key can be used by anyone during the authentication phase. Is this the case or other motivations are present?
~/.ssh/known_hosts
-- those are the server publickeys, saved and used for checking. If PuTTY/Win or compatible including WinSCP, check your registry underHKCU\Software\SimonTatham\PuTTY\SshHostKeys
(added) Note this authenticates the server not the client.