Eri*_*ang 5 git ssh openssh github ssh-agent
我正在使用 linux ( mint mate 17.2 ),当通过 ssh 推送到 github 时,有时连接失败,通常在重新启动计算机和网络后恢复。几天后,它可能会再次变坏,相当混乱。
通过http推送从来没有这样的问题,但它需要密码,不方便。
通过 ssh 推送时:
debug1:连接到 github.com [192.30.252.129] 端口 22。
它卡在上面的行。
然后经过漫长的等待,得到超时提示:
debug1:连接到地址 192.30.252.129 端口 22:连接超时
ssh:连接到主机 github.com 端口 22:连接超时
致命:无法从远程存储库读取。
可能是什么原因,如何解决?
平是好的:
eric@eric-pc:~$ ping 192.30.252.129
PING 192.30.252.129 (192.30.252.129) 56(84) bytes of data.
64 bytes from 192.30.252.129: icmp_seq=1 ttl=50 time=345 ms
64 bytes from 192.30.252.129: icmp_seq=2 ttl=50 time=452 ms
64 bytes from 192.30.252.129: icmp_seq=3 ttl=50 time=373 ms
64 bytes from 192.30.252.129: icmp_seq=4 ttl=50 time=349 ms
64 bytes from 192.30.252.129: icmp_seq=5 ttl=50 time=346 ms
64 bytes from 192.30.252.129: icmp_seq=6 ttl=50 time=442 ms
64 bytes from 192.30.252.129: icmp_seq=7 ttl=50 time=344 ms
Run Code Online (Sandbox Code Playgroud)
telnet 不好:
eric@eric-pc:~$ telnet 192.30.252.129 22
Trying 192.30.252.129...
Run Code Online (Sandbox Code Playgroud)
我在同一网络中设置了另一台计算机,使用相同的ssh密钥,它成功通过ssh推送到github,而原始计算机仍然超时。
行动:
重启网络,还是无法连接。
重启 ssh-agent,还是无法连接,旧的进程变成了一个不存在的 ssh-agent 进程,而有一个新的 ssh-agent :
埃里克 2552 0.0 0.0 0 0 ? Zs Jan08 0:00 [ssh-agent]
埃里克 27080 0.0 0.0 10628 316?ss 15:26 0:00 ssh-agent
eric 27168 0.0 0.0 17028 2548 pts/7 S+ 15:27 0:00 grep --color=auto ssh-agent
猜测:
其实,在问之前,从谷歌,我看到了类似的问题,但没有人解决问题,也没有人解释原因。
而且这个问题真的很烦人,因为我不想每次推送都输入密码,也不想时不时地重启我的电脑,有什么帮助吗?
尝试使用命令更改 git 默认 ssh 端口,
$ git remote add origin ssh://user@host:1234/srv/git/example并将 ssh 端口更改为 1234。您可以使用您喜欢的任何其他端口而不是 1234(建议大于 1000)。看看它是否可以解决您的问题。:)
如果不退出创建一个,请尝试更改 ~/.ssh/config 文件。
Host github.com
Port 22
Host *
Port 1234
| 归档时间: |
|
| 查看次数: |
2290 次 |
| 最近记录: |