当前位置:   article > 正文

reset by 192.30.255.112 port 22;connect to host github.com port 22: Connection timed out——解决问题的过程记录_connection reset by 192.30.255.113 port 22 could n

connection reset by 192.30.255.113 port 22 could not read from remote reposi

参考文章:

https://blog.csdn.net/vosang/article/details/50499300

https://blog.csdn.net/u014343528/article/details/48787221

 

一、问题描述

使用IDEA进行Push的时候报错:

  1. Push failed
  2.             Connection reset by 192.30.255.112 port 22
  3.             Could not read from remote repository.
  4.             Please make sure you have the correct access rights
  5.             and the repository exists.

 

二、解决问题的过程记录

2.1 查看idea有没有和github连接上

file -> settings ->Virson Control -> github,如果没有连接的话输入用户密码进行连接

 

2.2 在github中新建SSH key

1. git bash here,在终端输入:

ssh-keygen -t rsa -C "username" (注:username为github上的用户名)

如图:

2. 回车,输入y。应为之前有生成过key,这里将它覆盖

3. 提示让你输入 passphrase,不管,直接回车

4. 重复输入,也是不管,直接回车

如图,生成的文件位置位于C:/Users/UserName/.ssh/id-rsa

5. 输入下面的语句,显示文件内容

cat C:/Users/iwaed/.ssh/id_rsa.pub

文件内容如下:

 6. 在github中的settings中找到SSH Key,new一个,名字自己写,然后把这个以ssh-rsa开头的这一串复制到新建的ssh key中

 

2.3 依旧报错

  1. Ssh: connect to host github.com port 22: Connection timed out
  2. Could not read from remote repository.
  3. Please make sure you have the correct access rights
  4. and the repository exists.

 

2.4 新建config

1. 检查SSH是否能够连接成功。在终端输入以下命令:

ssh -T git@github.com

如图:报错不能连接

2. 打开.ssh文件目录,在Users/用户名/.shh,新建一个config,没有后缀

3. config文件内容如下:

  1. Host github.com
  2. User YourEmail@163.com(GitHub的账号名称)
  3. Hostname ssh.github.com
  4. PreferredAuthentications publickey
  5. IdentityFile ~/.ssh/id_rsa
  6. Port 443

4. 再次执行ssh -T git@github.com,如图:

以上,再次尝试push即可成功

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/819344
推荐阅读
相关标签
  

闽ICP备14008679号