我无法在git中使用github或bitbucket或gitlab 我通常有以下错误消息:我该如何避免它?
==========输出============
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
答案 0 :(得分:0)
ISP已阻止端口22. 已解决!
答案 1 :(得分:0)
终止SSH进程并重新启动它。它解决了我类似的问题。我发现有多个SSH实例,在这种情况下你必须全部杀掉它们。
答案 2 :(得分:-1)
时会出现此错误消息
OP确认ISP已阻止端口22。
看看您是否可以使用https网址:
cd /path/to/my/local/repo
git remote set-url origin https://github.com/<user>/<repo>
请注意,使用 trystack ,您可能需要follow this gist
单击“安全组”选项卡,单击“编辑规则”,然后添加一些规则:
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