Currently, it's not possible to gracefully replace old host keys with new ones:
There is no facility in the SSH transport protocol that allows a
server to gracefully rotate its host keys. Unless coordinated out-
of-band, a server changing host keys in this model is a hard break of
connection trust, as any client that had learned the previous host
key would now be met with an unexpected and untrusted key attempting
to authenticate the final key exchange. This situation is
effectively indistinguishable from an on-path adversary hijacking the
connection.
While this is not possible with the base protocol, there is a protocol extension – https://datatracker.ietf.org/doc/draft-ietf-sshm-hostkey-update/ – which is implemented in OpenSSH.
dstack-sshproxy could also support this draft specification as a mechanism for host key rotation.
Currently, it's not possible to gracefully replace old host keys with new ones:
While this is not possible with the base protocol, there is a protocol extension – https://datatracker.ietf.org/doc/draft-ietf-sshm-hostkey-update/ – which is implemented in OpenSSH.
dstack-sshproxycould also support this draft specification as a mechanism for host key rotation.