github ssh连接失败

ssh -T [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in C:\\Users\\zhang/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\\Users\\zhang/.ssh/known_hosts:1
Host key for github.com has changed and you have requested strict checking.
Host key verification failed.

通过ssh连接github失败,将known_hosts中github相关的条目删掉!!!!

再次尝试

ssh -T [email protected]
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Hi novaCoder-zrk! You've successfully authenticated, but GitHub does not provide shell access.

当通过ssh连接的github仓库尝试pull的时候,报错。

git pull kex_exchange_identification: Connection closed by remote host
Connection closed by 20.205.243.166 port 22 fatal: Could not read from
remote repository.

Please make sure you have the correct access rights and the repository
exists.

先把 .ssh 文件夹下的known_hosts known_hosts .old 中有关github的都删除。然后执行下面的语句:

ssh -T [email protected]

The authenticity of host ‘github.com
(20.205.243.166)’ can’t be established. ED25519 key fingerprint is
********8. This key is not
known by any other names Are you sure you want to continue connecting
(yes/no/[fingerprint])? yes Warning: Permanently added ‘github.com’
(ED25519) to the list of known hosts. Hi *******! You’ve
successfully authenticated, but GitHub does not provide shell access.

当删除远程镜像,添加新的远程

 git branch --set-upstream-to=origin/master

把本地和远程镜像连接上。

然后 git pull

你可能感兴趣的:(linux,github,ssh,git)