why the sshd public-key is changed

Asked by ame on 2012-10-21

I just modify the /etc/ssh/sshd_config,and restart sshd.(Ubuntu 12.04 server).

change the ssh port and don't allow root to login.

Then the public-key is changed,when I re-connected.is it normal case? I mean,what circumstances´╝îpublic-key will be changed?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openssh Edit question
Assignee:
No assignee Edit question
Solved by:
ame
Solved:
2012-10-22
Last query:
2012-10-22
Last reply:
2012-10-21

Are there any bugs reported? If not I suggest you report one

ame (feicunrain) said : #2

thx,but I think I I have solved this problem.

putty newest version under windows ( and some openssh cilent under linux),save the port and IP as a part of "known_host".I edit the /etc/ssh/sshd_config to modify the port. Putty stores known hosts under a registry key: HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys. for exmaple : rsa-2@22:120.0.0.1 key value is the public key.

So if I connect to the server,putty search the registry, even the rsa-2@22:127.0.0.1 exists,but the rsa-2@changed-port:127.0.0.1 don't exists. Putty can't find the pub-key so it think that the pub-key is changed or it is a new machine but it's not ! I think this is really a bug of putty,but not openssh : )