首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ssh连接超时

ssh连接超时
EN

Stack Overflow用户
提问于 2017-08-05 12:06:44
回答 3查看 2.9K关注 0票数 3

我无法在git中ssh到github、bitbucket或gitlab。

我通常会有以下错误消息:我如何避免它?

==========输出============

代码语言:javascript
复制
ssh -T git@github.com -i ~/.ssh/id_rsa -v
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: connect to address 192.30.255.113 port 22: Connection timed out
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: connect to address 192.30.255.112 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
EN

回答 3

Stack Overflow用户

发布于 2017-08-06 11:34:05

ISP已阻止端口22。解决了

票数 2
EN

Stack Overflow用户

发布于 2017-08-16 20:05:21

终止SSH进程并重新启动它。它解决了我类似的问题。我发现了SSH的多个实例,在这种情况下,您必须将它们全部杀死。

票数 1
EN

Stack Overflow用户

发布于 2017-08-05 13:49:30

此错误消息通常在以下情况下出现

  • 远程ssh守护进程未运行(此处GitHub、BitBucket或GitLab不是这种情况)
  • 本地端口22被阻止进行传出连接(这通常是在企业中工作时的情况:只有http(s)是打开的,而不是ssh)

操作人员确认ISP已阻止端口22。

看看是否可以使用https url:

代码语言:javascript
复制
cd /path/to/my/local/repo
git remote set-url origin https://github.com/<user>/<repo>

请注意,使用时,您可能需要follow this gist

单击安全组选项卡,单击编辑规则,然后添加两条规则:

代码语言:javascript
复制
imcp, from port: -1, to port: -1, cidr: 0.0.0.0/0
tcp, from port: 22, to port: 22, cidr: your.ip.address.here/32
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45518078

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档