赞
踩
参考文章:
https://blog.csdn.net/vosang/article/details/50499300
https://blog.csdn.net/u014343528/article/details/48787221
使用IDEA进行Push的时候报错:
- Push failed
- Connection reset by 192.30.255.112 port 22
- Could not read from remote repository.
- Please make sure you have the correct access rights
- and the repository exists.
file -> settings ->Virson Control -> github,如果没有连接的话输入用户密码进行连接
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中
- Ssh: connect to host github.com port 22: Connection timed out
- Could not read from remote repository.
- Please make sure you have the correct access rights
- and the repository exists.
1. 检查SSH是否能够连接成功。在终端输入以下命令:
ssh -T git@github.com
如图:报错不能连接
2. 打开.ssh文件目录,在Users/用户名/.shh,新建一个config,没有后缀
3. config文件内容如下:
- Host github.com
- User YourEmail@163.com(GitHub的账号名称)
- Hostname ssh.github.com
- PreferredAuthentications publickey
- IdentityFile ~/.ssh/id_rsa
- Port 443
4. 再次执行ssh -T git@github.com,如图:
以上,再次尝试push即可成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。