@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 RSA key sent by the remote host is SHA256:2rAd4Uy45Mm8txcdfvJt7MWhbVVXJG/eZP3R+oCPB3E. Please contact your system administrator. Add correct host key in /Users/zhanghao/.ssh/known_hosts to get rid of this message. Offending RSA key in /Users/zhanghao/.ssh/known_hosts:3 RSA host key for 192.168.*.* has changed and you have requested strict checking. Host key verification failed.
gitlab遷移項目,hostkey改變,每一個終端也要在跟着改一下。git
首先刪除本來的ssh key:github
rm -rf ~/.ssh/known_hosts
生成新的ssh keyshell
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
一路回車,須要選擇的時候輸入ydom
Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/zhanghao/.ssh/id_rsa): /c/Users/zhanghao/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/zhanghao/.ssh/id_rsa. Your public key has been saved in /c/Users/zhanghao/.ssh/id_rsa.pub. The key fingerprint is: SHA256:6NQTy8it6pl6Z2o2KLaiHkb/DPIa1ZislxUYhoAmPx8 your_email@example.com The key's randomart image is: +---[RSA 4096]----+ |+ .o | |oo. o | |o. . . . | | + E..* o | | . B += S | |. + +o . . | | * * o | |+.B O+o | |*=+B*B | +----[SHA256]-----+
測試ssh key鏈接。ssh
$ ssh -T git@github.com
以下面表示已經鏈接成功:ide
$ ssh -T git@github.com Hi yourname! You've successfully authenticated, but GitHub does not provide shell access.
但我出現的是這種狀況:gitlab
The authenticity of host 'github.com (13.229.XXX.XX)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,13.229.XXX.XX' (RSA) to the list of known hosts. Hi yourname! You've successfully authenticated, but GitHub does not provide shell access.
在第三行輸入yes便可。測試