How to upgrade SSHD without the change of the server key?

So we require to update the SSHD. Just how can we do this without having that concern that individuals (that are checking in via ssh) would certainly see the message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
0e:a1:b1:40:85:a2:a7:03:17:1b:52:8f:10:c7:b3:d0.
Please contact your system administrator.
Add correct host key in /home/USERNAME/.ssh/known_hosts to get rid of this message.
Offending key in /home/USERNAME/.ssh/known_hosts:13
RSA host key for [192.168.1.1]:22 has changed and you have requested strict checking.
Host key verification failed.
3
2022-06-07 14:38:47
Source Share
Answers: 1

Just updating sshd commonly will not change the host key. So of course simply update it and also it need to be great.

Keep in mind: You will not commonly require this yet if you intend to play it safe you can create a back-up of the ssh host keys and also replicate them back after you updated your system. Commonly you would certainly need to backup /etc/ssh/ssh_host*. If something failed you can recover the documents later on.

5
2022-06-07 15:11:31
Source