sshKey

sshKey 记录

今天传代码的时候,发现一直报连接超时,kex_exchange_identification: Connection closed by remote host,Please make sure you have the correct access rights and the repository exists. 突然又郁闷了。搜了一圈之后,发现好像是远程密钥的问题。在出现Are you sure want to continue connecting (yes/no/[fingerprint])? 的时候,输入yes,然后就OK了。

ssh 生成公钥的命令

  • ssh-keygen -t rsa -C "GitHub账号的注册邮箱"

一般是在 ~\username\.ssh 目录下。将id_rsa.pub里的内容复制到github的ssh key里。

  • 在 ~\username\.ssh 目录下,新建一个config文件,将一下内容复制进去,解决了超时的问题:
1
2
3
4
5
6
7
Host github.com

Hostname ssh.github.com

Port 443

User git

参考链接

https://github.com/orgs/community/discussions/55269

https://www.cnblogs.com/gosun/p/13044672.html

https://stackoverflow.com/questions/11443687/the-authenticity-of-host-cant-be-established