$ ssh user@remote_host
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:xxxxxxxxx7RxS+v+7D/cS380Gp2k42xxxxxxxxxxxxx
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/user/.ssh/known_hosts:14
remove with:
ssh-keygen -f '/home/user/.ssh/known_hosts' -R 'remote_host'
Host key for remote_host has changed and you have requested strict checking.
Host key verification failed.
- ปัญหาคือ server ใหม่ แต่ใช้ ip เดิม key เปลี่ยน สร้าง key ใหม่
Solved
$ ssh-keygen -R <remote_host>
Add
- ทำการตั้งค่า private key authen ใหม่ กรณี client มี public key อยู่แล้ว และ มี username เดียวกันระหว่าง client กับ remote host นะคับใช้คำสั่งเดียวเลย
$ ssh-copy-id username@remote_host
Related
- https://juuier.blogspot.com/2021/06/set-remote-ssh-by-public-key.html